15551

BCG注册表清除:
第一次在CXXXApp::ExitInstance()  加入CleanState(),
运行一次
接着注释掉,再在OnInitInstance加入m_bSaveState=FALSE
 

估计在BCG控件要写注册表的时候,它自己的写入注册表函数会判断m_bSaveState

1.VC2008集成了BCGControlBar的相关功能,用wizard生成的话如果选与BCGControlBar有关的性能,如预定皮肤,则应用程序是从CWinAppEx派生,再加CBCGPWorkspace似乎不行。


2.BCG 为了方便程序员,在注册表中保存了窗口的大小、位置等信息,包括工具栏的相应信息。这样减少了程序员保存和恢复用户上次使用过的界面的重复劳动。但也会造成改变菜单之类出现无反应的现象,让人摸不着头脑。可以采用的一个方法是,删除 BCG 为你保存的注册表键:
HKEY_CURRENT_USER/Software/[your corporation]/[your application]/Workspace
里面 your corporation 是指在 app 类里面 SetRegistryKey 指定的路径;your application 就是你的应用程序名。
把这个删掉之后,还是用你最上面的代码,运行。OK!

更方便的是InitInstance里设m_bSaveState=FALSE;

如果已经有注册内容了再加一句CleanState();

程序成型后再加上。


3.应用皮肤的过程
(1)找一个BCG的例子,将菜单与皮肤相关的项复制粘贴到你的菜单下,ID值是连续的。

(2)CMainFrame的头文件中
#define CFrameWnd CBCGPFrameWnd//类定义前。这样可以省很多替换工作哦
 UINT m_nAppLook;//指示应用哪个皮肤
 CBCGPMenuBar  m_wndMenuBar;
//手动加入消息响应:
 afx_msg void OnAppLook(UINT id);
 afx_msg void OnUpdateAppLook(CCmdUI* pCmdUI);

(3)CMainFrame的Cpp文件
//消息映射增加
 ON_COMMAND_RANGE(ID_VIEW_APPLOOK_2000, ID_VIEW_APPLOOK_VS2008, OnAppLook) //这是范围的响应,所以ID要连续
 ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_APPLOOK_2000, ID_VIEW_APPLOOK_VS2008, OnUpdateAppLook)
//初始化函数
 m_nAppLook = theApp.GetInt (_T("ApplicationLook"), ID_VIEW_APPLOOK_2003);//初始的样子
//OnCreate
 OnAppLook (m_nAppLook);

 if (!m_wndMenuBar.Create (this))
 {
  TRACE0("Failed to create menubar/n");
  return -1;      // fail to create
 }

 m_wndMenuBar.SetBarStyle(m_wndMenuBar.GetBarStyle() | CBRS_SIZE_DYNAMIC);

 m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
 EnableDocking(CBRS_ALIGN_ANY);
 EnableAutoHideBars(CBRS_ALIGN_ANY);
 DockControlBar(&m_wndMenuBar);                     //可浮动

//直接把以下两个函数拷贝上去就OK了。
void CMainFrame::OnAppLook(UINT id)
{
 CBCGPDockManager::SetDockMode (BCGP_DT_SMART);

 m_nAppLook = id;

 switch (m_nAppLook)
 {
 case ID_VIEW_APPLOOK_2000:
  // enable Office 2000 look:
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager));
  break;

 case ID_VIEW_APPLOOK_XP:
  // enable Office XP look:
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerXP));
  break;

 case ID_VIEW_APPLOOK_WIN_XP:
  // enable Windows XP look (in other OS Office XP look will be used):
  CBCGPWinXPVisualManager::m_b3DTabsXPTheme = TRUE;
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPWinXPVisualManager));
  break;

 case ID_VIEW_APPLOOK_2003:
  // enable Office 2003 look:
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2003));
  CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
  break;

 case ID_VIEW_APPLOOK_VS2005:
  // enable VS 2005 look:
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerVS2005));
  CBCGPVisualManager::GetInstance ();
  CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
  break;

 case ID_VIEW_APPLOOK_VS2008:
  // enable VS 2008 look:
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManagerVS2008));
  CBCGPVisualManager::GetInstance ();
  CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
  break;

 case ID_VIEW_APPLOOK_2007_1:
  // enable Office 2007 look:
  CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_LunaBlue);
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007));
  CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
  break;

 case ID_VIEW_APPLOOK_2007_2:
  // enable Office 2007 look:
  CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_ObsidianBlack);
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007));
  CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
  break;

 case ID_VIEW_APPLOOK_2007_3:
  // enable Office 2007 look:
  CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_Aqua);
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007));
  CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
  break;

 case ID_VIEW_APPLOOK_2007_4:
  // enable Office 2007 look:
  CBCGPVisualManager2007::SetStyle (CBCGPVisualManager2007::VS2007_Silver);
  CBCGPVisualManager::SetDefaultManager (RUNTIME_CLASS (CBCGPVisualManager2007));
  CBCGPDockManager::SetDockMode (BCGP_DT_SMART);
  break;

 default:
  ASSERT (FALSE);
 }

 CBCGPDockManager* pDockManager = GetDockManager ();
 if (pDockManager != NULL)
 {
  ASSERT_VALID (pDockManager);
  pDockManager->AdjustBarFrames ();
 }

 RecalcLayout ();
 RedrawWindow (NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);

 theApp.WriteInt (_T("ApplicationLook"), m_nAppLook);
}


void CMainFrame::OnUpdateAppLook(CCmdUI* pCmdUI)
{
 pCmdUI->SetRadio (m_nAppLook == pCmdUI->m_nID);
}

4.上下文菜单

(1)当然是新建一个需要的上下文菜单

(2)应用程序类的头文件下

 virtual void PreLoadState ();

Cpp文件

void C***App::PreLoadState ()
{

 GetContextMenuManager()->AddMenu (_T("My menu"), IDR_CONTEXT_MENU);//IDR_CONTEXT_MENU是菜单的ID

 // TODO: add another context menus here
}

(3)响应上下文菜单的视图类中增加对上下文菜单消息的响应

void C***View::OnContextMenu(CWnd* , CPoint point)
{
 theApp.ShowPopupMenu (IDR_CONTEXT_MENU, point, this);
 // TODO: 在此处添加消息处理程序代码
}

2.

BCG例子BCGPExplorer:

1.BCG的菜单、工具栏、动画图标和地址栏

这是BCG的主要特色,也比较繁琐。

(1)如果要支持自定义工具。

首先在String表定义入口ID:ID_TOOLS_ENTRY,与某菜单项关联。然后定义连续的ID,如ID_USER_TOOL1、ID_USER_TOOL2......。

在App下增加 EnableUserTools (ID_TOOLS_ENTRY, ID_USER_TOOL1, ID_USER_TOOL10);

(2)主要是修改CMainFrame

头文件声明

 CBCGPMenuBar  m_wndMenuBar;
 CBCGPStatusBar m_wndStatusBar;
 CBCGPToolBar  m_wndToolBar;
 CBCGPReBar   m_wndReBar;  //菜单、工具栏、地址栏的容器
 CBCGPAnimCtrl m_wndAnimate;//动画控件
 CComboBoxEx  m_wndAddress;//地址栏

增加响应自定义工具的消息函数OnViewCustomize

手动添加消息响应

 afx_msg LRESULT OnToolbarReset(WPARAM,LPARAM);
 afx_msg LRESULT OnToolbarContextMenu(WPARAM,LPARAM);

 虚函数virtual BOOL OnShowPopupMenu (CBCGPPopupMenu* pMenuPopup);

Cpp文件

 ON_REGISTERED_MESSAGE(BCGM_RESETTOOLBAR, OnToolbarReset)
 ON_REGISTERED_MESSAGE(BCGM_TOOLBARMENU, OnToolbarContextMenu)

OnCreate()函数

 CBCGPToolBar::EnableQuickCustomization ();

 CBCGPToolBar::SetSizes (CSize (28, 28), CSize (22, 22));//工具栏大小
 CBCGPToolBar::SetMenuSizes (CSize (22, 22), CSize (16, 16));//工具栏中下拉菜单项大小

//指定常用的工具,其它会自动收缩。每个下拉(pulldown)菜单条至少要有一项

 CList<UINT, UINT> lstBasicCommands;

 lstBasicCommands.AddTail (ID_VIEW_TOOLBARS);
 lstBasicCommands.AddTail (ID_APP_EXIT);
 lstBasicCommands.AddTail (ID_APP_ABOUT);
 lstBasicCommands.AddTail (ID_VIEW_TOOLBAR);
 lstBasicCommands.AddTail (ID_VIEW_CUSTOMIZE);
 lstBasicCommands.AddTail (ID_COMMAND_HISTORY);
 lstBasicCommands.AddTail (ID_VIEW_LARGEICON);
 lstBasicCommands.AddTail (ID_VIEW_SMALLICON);
 lstBasicCommands.AddTail (ID_VIEW_LIST);
 lstBasicCommands.AddTail (ID_VIEW_DETAILS);
 lstBasicCommands.AddTail (ID_EDIT_CUT);
 lstBasicCommands.AddTail (ID_EDIT_COPY);
 lstBasicCommands.AddTail (ID_EDIT_PASTE);

 CBCGPToolBar::SetBasicCommands (lstBasicCommands);

 if (!m_wndMenuBar.Create (this))//菜单的创建
 {
  TRACE0("Failed to create menubar/n");
  return -1;      // fail to create
 }

 m_wndMenuBar.SetBarStyle(m_wndMenuBar.GetBarStyle() | CBRS_SIZE_DYNAMIC);

 // Remove menubar gripper and borders:
 m_wndMenuBar.SetBarStyle (m_wndMenuBar.GetBarStyle() &
  ~(CBRS_GRIPPER | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

//动画控件的创建,AFX_IDW_TOOLBAR为标准ID,IDB_ANIMATION是连续位图

 if (!m_wndAnimate.Create (_T(""), WS_CHILD | WS_VISIBLE, CRect(0, 0, 20, 20), this, AFX_IDW_TOOLBAR + 2) ||
  !m_wndAnimate.SetBitmap (IDB_ANIMATION, 20))
{
  TRACE0("Failed to create aimation/n");
  return -1;      // fail to create
 }

 m_wndAnimate.Play (500);

//检测颜色深度是256还是真彩色

 CClientDC dc (this);
 BOOL bIsHighColor = dc.GetDeviceCaps (BITSPIXEL) > 8;

 UINT uiToolbarHotID = bIsHighColor ? IDB_TOOLBAR256 : 0;  //IDB_TOOLBAR256真彩色图像(用作工具栏)
 UINT uiToolbarColdID = bIsHighColor ? IDB_TOOLBARCOLD256 : 0;
 UINT uiMenuID = bIsHighColor ? IDB_MENU256 : IDB_MENU16;

 if (!m_wndToolBar.CreateEx(this) ||
  !m_wndToolBar.LoadToolBar(IDR_MAINFRAME, uiToolbarColdID, uiMenuID, FALSE, 0, 0, uiToolbarHotID))//IDR_MAINFRAME是256色的预定义工具栏
 {
  TRACE0("Failed to create toolbar/n");
  return -1;      // fail to create
 }

 // Remove toolbar gripper and borders:
 m_wndToolBar.SetBarStyle (m_wndToolBar.GetBarStyle() &
  ~(CBRS_GRIPPER | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

//创建地址栏

 if (!m_wndAddress.Create (CBS_DROPDOWN | WS_CHILD, CRect(0, 0, 200, 120), this, AFX_IDW_TOOLBAR + 1))
 {
  TRACE0("Failed to create combobox/n");
  return -1;      // fail to create
 }

 //将各项加入rebar面板
 DWORD dwStyle = RBBS_GRIPPERALWAYS | RBBS_FIXEDBMP | RBBS_BREAK;

 if (!m_wndReBar.Create(this) ||
  !m_wndReBar.AddBar (&m_wndMenuBar) ||
  !m_wndReBar.AddBar (&m_wndToolBar, NULL, NULL, dwStyle) ||
  !m_wndReBar.AddBar(&m_wndAnimate, NULL, NULL, RBBS_FIXEDSIZE | RBBS_FIXEDBMP) ||
  !m_wndReBar.AddBar(&m_wndAddress, _T("Address"), NULL, dwStyle))
 {
  TRACE0("Failed to create rebar/n");
  return -1;      // fail to create
 }

 m_wndMenuBar.AdjustLayout ();
 m_wndToolBar.AdjustLayout ();

 //--------------------------------------------------------------
 // Set up min/max sizes and ideal sizes for pieces of the rebar:
 //--------------------------------------------------------------
 REBARBANDINFO rbbi;

 CRect rectToolBar;
 m_wndToolBar.GetItemRect(0, &rectToolBar);

 rbbi.cbSize = sizeof(rbbi);
 rbbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_SIZE;
 rbbi.cxMinChild = rectToolBar.Width();
 rbbi.cyMinChild = rectToolBar.Height();
 rbbi.cx = rbbi.cxIdeal = rectToolBar.Width() * m_wndToolBar.GetCount ();
 m_wndReBar.GetReBarCtrl().SetBandInfo (1, &rbbi);
 rbbi.cxMinChild = 0;

 CRect rectAddress;
 m_wndAddress.GetEditCtrl()->GetWindowRect(&rectAddress);

 rbbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE;
 rbbi.cyMinChild = rectAddress.Height() + 10;
 rbbi.cxIdeal = 200;
 m_wndReBar.GetReBarCtrl().SetBandInfo (3, &rbbi);//基于上面的AddBar所定的顺序

 // 菜单和工具栏允许增加自定义按钮
 m_wndMenuBar.EnableCustomizeButton (TRUE, (UINT)-1, _T(""));
 m_wndToolBar.EnableCustomizeButton (TRUE, (UINT)-1, _T(""));

 EnableDocking (CBRS_ALIGN_ANY);

 m_wndReBar.EnableDocking (CBRS_TOP);//可以浮动和停靠
 DockControlBar (&m_wndReBar);

 CString strMainToolbarTitle;
 strMainToolbarTitle.LoadString (IDS_MAIN_TOOLBAR);
 m_wndToolBar.SetWindowText (strMainToolbarTitle);

 // TODO: Remove this if you don't want tool tips
 m_wndMenuBar.SetBarStyle(m_wndMenuBar.GetBarStyle() |
  CBRS_TOOLTIPS | CBRS_FLYBY);
 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  CBRS_TOOLTIPS | CBRS_FLYBY);

void CMainFrame::OnViewCustomize()
{
 //------------------------------------
 // Create a customize toolbars dialog:
 //------------------------------------
 CBCGPToolbarCustomize* pDlgCust = new CBCGPToolbarCustomize (this,
  TRUE
  );

 pDlgCust->Create ();
}

LRESULT CMainFrame::OnToolbarContextMenu(WPARAM,LPARAM lp)
{
 CPoint point (BCG_GET_X_LPARAM(lp), BCG_GET_Y_LPARAM(lp));

 CMenu menu;
 VERIFY(menu.LoadMenu (IDR_POPUP_TOOLBAR));

 CMenu* pPopup = menu.GetSubMenu(0);
 ASSERT(pPopup != NULL);

 CBCGPPopupMenu* pPopupMenu = new CBCGPPopupMenu;
 pPopupMenu->Create (this, point.x, point.y, pPopup->Detach ());

 return 0;
}

//替换256色标准工具栏IDR_MAINFRAME为真彩色

afx_msg LRESULT CMainFrame::OnToolbarReset(WPARAM wp, LPARAM)
{
 UINT uiToolBarId = (UINT) wp;
 if (uiToolBarId != IDR_MAINFRAME)
 {
  return 0;
 }

 // Replace "Back" and "Forward" buttons by the menu buttons
 // with the history lists:

 CMenu menuHistory;
 menuHistory.LoadMenu (IDR_HISTORY_POPUP);

 CBCGPToolbarMenuButton btnBack (ID_GO_BACK, menuHistory,
     CImageHash::GetImageOfCommand (ID_GO_BACK), _T("Back"));//带菜单的按钮
 btnBack.m_bText = TRUE;
 m_wndToolBar.ReplaceButton (ID_GO_BACK, btnBack);

 m_wndToolBar.ReplaceButton (ID_GO_FORWARD,
  CBCGPToolbarMenuButton (ID_GO_FORWARD, menuHistory,
     CImageHash::GetImageOfCommand (ID_GO_FORWARD), _T("Forward")));

 // "Folders" button has a text label:
 m_wndToolBar.SetToolBarBtnText (m_wndToolBar.CommandToIndex (ID_VIEW_FOLDERS),
  _T("Folders"));

 // Replace "Views" button by the menu button:
 CMenu menuViews;
 menuViews.LoadMenu (IDR_VIEWS_POPUP);

 m_wndToolBar.ReplaceButton (ID_VIEW_VIEWS,
  CBCGPToolbarMenuButton ((UINT)-1, menuViews,
     CImageHash::GetImageOfCommand (ID_VIEW_VIEWS), _T("Views")));

 return 0;
}

BOOL CMainFrame::OnShowPopupMenu (CBCGPPopupMenu* pMenuPopup)
{
 //---------------------------------------------------------
 // 将占位的ID_VIEW_TOOLBARS菜单项替换为IDR_POPUP_TOOLBAR:
 //---------------------------------------------------------
    CFrameWnd::OnShowPopupMenu (pMenuPopup);

    if (pMenuPopup != NULL &&
  pMenuPopup->GetMenuBar ()->CommandToIndex (ID_VIEW_TOOLBARS) >= 0)
    {
  if (CBCGPToolBar::IsCustomizeMode ())
  {
   //----------------------------------------------------
   // Don't show toolbars list in the cuztomization mode!
   //----------------------------------------------------
   return FALSE;
  }

  pMenuPopup->RemoveAllItems ();

  CMenu menu;
  VERIFY(menu.LoadMenu (IDR_POPUP_TOOLBAR));

  CMenu* pPopup = menu.GetSubMenu(0);
  ASSERT(pPopup != NULL);

  pMenuPopup->GetMenuBar ()->ImportFromMenu (*pPopup, TRUE);
    }

 return TRUE;
}

3.

补充CBCGPToolBar的使用

CMainFrame::OnCreate下

(1) CBCGPToolBar::EnableQuickCustomization ();//按Alt键时可以拖动工具栏上的图标重新排列

(2) m_wndToolBar.EnableCustomizeButton (TRUE, ID_VIEW_CUSTOMIZE, _T("Customize..."));

//允许自定义工具栏,名字“Customize”,并与菜单项ID_VIEW_CUSTOMIZE关联。

 

void CMainFrame::OnViewCustomize()
{//在BCG标准的自定义工具栏中加入新的属性页
 CList <CRuntimeClass*, CRuntimeClass*> lstCustomPages;
 lstCustomPages.AddTail (RUNTIME_CLASS (CMyCustomizationPage));

//CMyCustomizationPage是一个自定义的属性页
 //------------------------------------
 // Create a customize toolbars dialog:
 //------------------------------------
 CBCGPToolbarCustomize* pDlgCust = new CBCGPToolbarCustomize (this,
  TRUE ,
  BCGCUSTOMIZE_MENU_SHADOWS | BCGCUSTOMIZE_TEXT_LABELS |
  BCGCUSTOMIZE_LOOK_2000 | BCGCUSTOMIZE_MENU_ANIMATIONS, // default parameters
  &lstCustomPages); // pointer to the list of runtime classes of the custom property pages

 pDlgCust->Create ();
}

(3)将占位菜单项ID_VIEW_TOOLBARS替换为菜单IDR_POPUP_TOOLBAR

virtual BOOL OnShowPopupMenu (CBCGPPopupMenu* pMenuPopup);

BOOL CMainFrame::OnShowPopupMenu (CBCGPPopupMenu* pMenuPopup)
{
 //---------------------------------------------------------
 // Replace ID_VIEW_TOOLBARS menu item to the toolbars list:
 //---------------------------------------------------------
    CFrameWnd::OnShowPopupMenu (pMenuPopup);

    if (pMenuPopup != NULL &&
  pMenuPopup->GetMenuBar ()->CommandToIndex (ID_VIEW_TOOLBARS) >= 0)
    {
  if (CBCGPToolBar::IsCustomizeMode ())
  {
   //----------------------------------------------------
   // Don't show toolbars list in the cuztomization mode!
   //----------------------------------------------------
   return FALSE;
  }

  pMenuPopup->RemoveAllItems ();

  CMenu menu;
  VERIFY(menu.LoadMenu (IDR_POPUP_TOOLBAR));

  CMenu* pPopup = menu.GetSubMenu(0);
  ASSERT(pPopup != NULL);

  pMenuPopup->GetMenuBar ()->ImportFromMenu (*pPopup, TRUE);
    }

 return TRUE;
}

 


IDR_POPUP_TOOLBAR菜单

4.

在对话框中使用菜单、工具栏等

DlgBars解析

 

(1)在对话框资源中进行占位,设置相应ID,产生相应变量

 CStatic m_wndMenuBarLocation;//菜单
 CStatic m_wndStatusBarLocation;//状态栏
 CStatic m_wndToolbarLocation;//工具栏
 CStatic m_wndOutlookBarLocation;//Outlook侧边栏
 CStatic m_wndCaptionLocation;//标题栏

 

(2)有关菜单的类

class CMyMenuBar : public CBCGPMenuBar

 

class CCmdFrame : public CBCGPFrameWnd

构造函数CCmdFrame(CBCGPDialog* pDlg);

BOOL CCmdFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
 ASSERT_VALID (m_pDlg);
 return m_pDlg->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);//转由对话框处理
}

class CMyFrameImpl : public CBCGPFrameImpl

//CBCGPFrameImpl实现工具栏的管理,包括从注册表读写状态,docking,键盘和鼠标消息等
{
 CMyFrameImpl() : CBCGPFrameImpl (NULL) {}

 friend class CCmdFrame;
};

void CCmdFrame::SetMenuBar (CBCGPMenuBar* pMenuBar)
{
 ((CMyFrameImpl&)m_Impl).m_pMenuBar = pMenuBar;//实际是把CMyMenuBar绑定到CMyFrameImpl
}

 

(3)对话框类

头文件

#define CDialog CBCGPDialog

定义:

 CBCGPOutlookBar  m_wndOutlookBar;
 CBCGPOutlookBarPane m_wndPane1;
 CBCGPOutlookBarPane m_wndPane2;

 CMyMenuBar   m_wndMenuBar;
 CBCGPCaptionBar  m_wndCaptionBar;
 CBCGPToolBar  m_wndToolBar;
 CBCGPStatusBar  m_wndStatusBar;

 CBitmap    m_bmpCaption;

 CCmdFrame*   m_pMenuFrame;

 

Cpp文件

OnInitDialog()

 // Create Outlook Bar:
 DWORD dwStyle = WS_CAPTION | WS_CHILD | WS_VISIBLE | CBRS_ALIGN_LEFT;
 DWORD dwBCGStyle = 0;
 m_wndOutlookBar.Create (_T("Shortcuts"), this, CRect (0, 0, 100, 100),
  AFX_IDW_TOOLBAR, dwStyle, dwBCGStyle);

 m_wndOutlookBar.EnableGripper (TRUE);

    m_wndOutlookBar.SetBarStyle (CBRS_ALIGN_LEFT | CBRS_TOOLTIPS | CBRS_FLYBY |
        CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

 m_wndOutlookBar.EnableSetCaptionTextToTabName (FALSE);

 m_wndPane1.Create (&m_wndOutlookBar, dwDefaultToolbarStyle, 1);
 m_wndPane1.SetWindowText (_T("Page 1"));
 m_wndOutlookBar.AddTab (&m_wndPane1);

 m_wndPane1.EnableTextLabels (TRUE);
 m_wndPane1.SetOwner (this);
 

 m_wndPane2.Create (&m_wndOutlookBar, dwDefaultToolbarStyle, 1);
 m_wndPane2.SetWindowText (_T("Page 2"));
 m_wndOutlookBar.AddTab (&m_wndPane2);

 m_wndPane2.EnableTextLabels (TRUE);
 m_wndPane2.SetOwner (this);

 // Add some shortcuts:
 m_wndPane1.AddButton (IDB_SHORTCUT1, "Shortcut 1", ID_SHORTCUT_1);
 m_wndPane1.AddButton (IDB_SHORTCUT2, "Shortcut 2", ID_SHORTCUT_2);


 m_wndPane2.AddButton (IDB_SHORTCUT3, "Shortcut 3", ID_SHORTCUT_3);
 m_wndPane2.AddButton (IDB_SHORTCUT4, "Shortcut 4", ID_SHORTCUT_4);

 CRect rectClient;
 GetClientRect (rectClient);

 // 在m_wndOutlookBarLocation所占位创建m_wndOutlookBar:
 CRect rectOutlookBar;
 m_wndOutlookBarLocation.GetWindowRect (&rectOutlookBar);
 ScreenToClient (&rectOutlookBar);

 m_wndOutlookBar.SetWindowPos (&wndTop, rectOutlookBar.left, rectOutlookBar.top,
      rectOutlookBar.Width (),
      rectClient.Height () - 2 * rectOutlookBar.top,
      SWP_NOACTIVATE);

 // Create menu bar:
 m_wndMenuBar.Create (this);

 CMenu menu;
 menu.LoadMenu (IDR_MAINFRAME);
 m_wndMenuBar.CreateFromMenu (menu.GetSafeHmenu (), TRUE, TRUE);

 m_wndMenuBar.SetBarStyle (
  m_wndMenuBar.GetBarStyle () &
   ~(CBRS_GRIPPER | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

 // Set menu bar position and size:
 CRect rectMenuBar;
 m_wndMenuBarLocation.GetWindowRect (&rectMenuBar);
 ScreenToClient (&rectMenuBar);

 m_wndMenuBar.SetWindowPos (&wndTop, rectMenuBar.left, rectMenuBar.top,
      rectMenuBar.Width (),
      rectMenuBar.Height (),
      SWP_NOACTIVATE);

 m_pMenuFrame = new CCmdFrame (this);
 m_pMenuFrame->Create (NULL, _T(""));
 m_pMenuFrame->ShowWindow (SW_HIDE);
 m_pMenuFrame->SetMenuBar (&m_wndMenuBar);

 m_wndMenuBar.SetOwner (m_pMenuFrame);//设定m_wndMenuBar的Owner为m_pMenuFrame
 BCGCBProSetTopLevelFrame (m_pMenuFrame);

 // Create caption bar:
 m_wndCaptionBar.Create (WS_CHILD | WS_VISIBLE, this, (UINT)-1);
 m_wndCaptionBar.SetText (_T("Caption"), CBCGPCaptionBar::ALIGN_LEFT);
 m_wndCaptionBar.SetFlatBorder ();

 // Load caption image:
 m_bmpCaption.LoadBitmap (IDB_CAPTION);
 m_wndCaptionBar.SetBitmap ((HBITMAP) m_bmpCaption.GetSafeHandle (), RGB (255, 0, 255));

 m_wndCaptionBar.SetBarStyle (
  m_wndCaptionBar.GetBarStyle () &
   ~(CBRS_GRIPPER | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

 // Set caption bar position and size:
 CRect rectCaptionBar;
 m_wndCaptionLocation.GetWindowRect (&rectCaptionBar);
 ScreenToClient (&rectCaptionBar);

 m_wndCaptionBar.SetWindowPos (&wndTop, rectCaptionBar.left, rectCaptionBar.top,
      rectCaptionBar.Width (),
      rectCaptionBar.Height (),
      SWP_NOACTIVATE);
 // Create toolbar:
 m_wndToolBar.Create (this);
 m_wndToolBar.LoadToolBar (IDR_MAINFRAME, 0, 0, TRUE );

 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  CBRS_TOOLTIPS | CBRS_FLYBY);
 
 m_wndToolBar.SetBarStyle (
  m_wndToolBar.GetBarStyle () &
   ~(CBRS_GRIPPER | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

 CSize sizeToolBar = m_wndToolBar.CalcFixedLayout (FALSE, TRUE);

 // Set ToolBar position and size:
 CRect rectToolBar;
 m_wndToolbarLocation.GetWindowRect (&rectToolBar);
 ScreenToClient (&rectToolBar);

 m_wndToolBar.SetWindowPos (&wndTop, rectToolBar.left, rectToolBar.top,
  sizeToolBar.cx, sizeToolBar.cy, SWP_NOACTIVATE);

 m_wndToolBar.SetOwner (this);

 // 指示m_wndToolBar的消息全部由对话框处理
 m_wndToolBar.SetRouteCommandsViaFrame (FALSE);
 
 // Create status bar:
 m_wndStatusBar.Create(this);
 m_wndStatusBar.SetIndicators(indicators,
    sizeof(indicators)/sizeof(UINT));

 // Set status bar position and size:
 CRect rectStatusBar;
 m_wndStatusBarLocation.GetWindowRect (&rectStatusBar);
 ScreenToClient (&rectStatusBar);

 m_wndStatusBar.SetWindowPos (&wndTop, rectStatusBar.left, rectStatusBar.top,
  rectStatusBar.Width (), rectStatusBar.Height (), SWP_NOACTIVATE);

 m_wndStatusBar.SetWindowText ("Test");

 

//消息处理

void CDlgBarsDlg::OnEditPaste()
{
 MessageBox ("OnEditPaste");
}

//状态更新

void CDlgBarsDlg::OnUpdateEditPaste(CCmdUI* pCmdUI)
{
 pCmdUI->SetCheck ();
}

 

LRESULT CDlgBarsDlg::OnKickIdle(WPARAM, LPARAM)
{
 m_wndToolBar.OnUpdateCmdUI ((CFrameWnd*) this, TRUE);
    return 0;
}

5.

工具提示控件

DlgToolTips

 


1.创建类class CCustomToolTipCtrl : public CBCGPToolTipCtrl

 virtual CSize GetIconSize ()
 {
  return CSize (32, 32);
 }


void CCustomToolTipCtrl::OnShow(NMHDR* pNMHDR, LRESULT* pResult)
{
 m_nCurrID = CWnd::FromHandle ((HWND)pNMHDR->idFrom)->GetDlgCtrlID ();

 switch (m_nCurrID)
 {
 case IDOK:
  m_strDesrciption = _T("OK Button description...");//基本描述
  break;

 case IDCANCEL:
  m_strDesrciption = _T("Cancel Button description...");
  break;

 default:
  m_strDesrciption.Empty ();
 }

 CBCGPToolTipCtrl::OnShow (pNMHDR, pResult);
}

 

BOOL CCustomToolTipCtrl::OnDrawIcon (CDC* pDC, CRect rectImage)
{
 UINT uiBmpResID = 0;

 switch (m_nCurrID)
 {
 case IDOK:
  uiBmpResID = IDB_OK;
  break;

 case IDCANCEL:
  uiBmpResID = IDB_CANCEL;
  break;
 }

 if (uiBmpResID == 0)
 {
  return FALSE;
 }

 CBCGPToolBarImages image;
 image.Load (uiBmpResID);
 image.SetSingleImage ();
 image.DrawEx (pDC, rectImage, 0);

 return TRUE;
}

2.对话框

OnInitDialog()

 CMenu* pSysMenu = GetSystemMenu(FALSE);//在系统菜单里增加一个新项
 if (pSysMenu != NULL)
 {
  CString strAboutMenu;
  strAboutMenu.LoadString(IDS_ABOUTBOX);
  if (!strAboutMenu.IsEmpty())
  {
   pSysMenu->AppendMenu(MF_SEPARATOR);
   pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
  }
 }


 
 // Create the ToolTip control.
 m_ToolTip.Create(this);
 m_ToolTip.Activate(TRUE);

 CBCGPToolTipParams params;
 params.m_bVislManagerTheme = TRUE;

 m_ToolTip.SetParams (&params);

 // TODO: Use one of the following forms to add controls:
 m_ToolTip.AddTool (GetDlgItem(IDOK), _T("This is OK button!"));//另外的描述
 m_ToolTip.AddTool (GetDlgItem(IDCANCEL), _T("This is Cancel button!"));

 

 

BOOL CDlgToolTipsDlg::PreTranslateMessage(MSG* pMsg)
{
    switch (pMsg->message)
 {
 case WM_KEYDOWN:
 case WM_SYSKEYDOWN:
 case WM_LBUTTONDOWN:
 case WM_RBUTTONDOWN:
 case WM_MBUTTONDOWN:
 case WM_LBUTTONUP:
 case WM_RBUTTONUP:
 case WM_MBUTTONUP:
 case WM_MOUSEMOVE:
  m_ToolTip.RelayEvent(pMsg);
  break;
 }
 
 return CBCGPDialog::PreTranslateMessage(pMsg);
}

 

本文来自优快云博客,转载请标明出处:http://blog.youkuaiyun.com/tengxiaoming/archive/2010/08/19/5822589.aspx

#include <iostream> using namespace std; int l,r,a[]={0,2,3,5,7,11,13,17,31,37,71,73,79,97,101,107,113,131,149,151,157,167,179,181,191,199,311,313,337,347,353,359,373,383,389,701,709,727,733,739,743,751,757,761,769,787,797,907,919,929,937,941,953,967,971,983,991,1009,1021,1031,1033,1061,1069,1091,1097,1103,1109,1151,1153,1181,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1279,1283,1301,1321,1381,1399,1409,1429,1439,1453,1471,1487,1499,1511,1523,1559,1583,1597,1601,1619,1657,1669,1723,1733,1741,1753,1789,1811,1831,1847,1867,1879,1901,1913,1933,1949,1979,3011,3019,3023,3049,3067,3083,3089,3109,3121,3163,3169,3191,3203,3221,3251,3257,3271,3299,3301,3319,3343,3347,3359,3371,3373,3389,3391,3407,3433,3463,3467,3469,3511,3527,3541,3571,3583,3613,3643,3697,3719,3733,3767,3803,3821,3851,3853,3889,3911,3917,3929,7027,7043,7057,7121,7177,7187,7193,7207,7219,7229,7253,7297,7321,7349,7433,7457,7459,7481,7507,7523,7529,7547,7561,7577,7589,7603,7643,7649,7673,7681,7687,7699,7717,7757,7817,7841,7867,7879,7901,7927,7949,7951,7963,9001,9011,9013,9029,9041,9103,9127,9133,9161,9173,9209,9221,9227,9241,9257,9293,9341,9349,9403,9421,9437,9439,9467,9479,9491,9497,9521,9533,9547,9551,9601,9613,9643,9661,9679,9721,9749,9769,9781,9787,9791,9803,9833,9857,9871,9883,9923,9931,9941,9967,10007,10009,10039,10061,10067,10069,10079,10091,10151,10159,10177,10247,10253,10273,10301,10321,10333,10343,10391,10429,10453,10457,10459,10487,10499,10501,10601,10613,10639,10651,10711,10739,10781,10853,10859,10867,10889,10891,10909,10939,10987,10993,11003,11057,11071,11083,11149,11159,11161,11197,11243,11257,11311,11329,11353,11411,11423,11447,11489,11497,11551,11579,11587,11593,11621,11657,11677,11699,11701,11717,11719,11731,11777,11779,11783,11789,11833,11839,11897,11903,11909,11923,11927,11933,11939,11953,11959,11969,11971,11981,12071,12073,12107,12109,12113,12119,12149,12227,12241,12253,12269,12289,12301,12323,12373,12421,12437,12491,12547,12553,12577,12611,12619,12641,12659,12689,12697,12713,12721,12743,12757,12763,12799,12809,12821,12829,12841,12893,12907,12919,12983,13009,13043,13147,13151,13159,13163,13259,13267,13291,13297,13331,13337,13441,13457,13469,13477,13499,13513,13523,13553,13591,13597,13619,13693,13697,13709,13711,13751,13757,13759,13781,13789,13829,13831,13841,13873,13903,13931,13933,13963,14029,14057,14071,14081,14087,14107,14143,14153,14177,14207,14221,14251,14293,14303,14323,14327,14341,14387,14423,14431,14447,14449,14479,14519,14549,14551,14557,14563,14591,14593,14621,14629,14633,14657,14713,14717,14741,14821,14831,14843,14879,14891,14897,14923,14929,14939,14947,14957,15013,15053,15091,15101,15131,15139,15149,15227,15241,15263,15289,15299,15307,15349,15377,15383,15451,15461,15493,15497,15511,15527,15541,15551,15601,15643,15649,15661,15667,15679,15683,15731,15733,15737,15791,15803,15907,15919,15937,15973,16001,16007,16061,16063,16073,16103,16111,16127,16193,16217,16223,16249,16267,16361,16427,16433,16451,16453,16481,16493,16547,16561,16567,16573,16603,16651,16661,16691,16699,16729,16747,16763,16829,16879,16883,16937,16943,16979,17011,17021,17033,17041,17047,17117,17203,17207,17209,17383,17393,17417,17443,17467,17471,17477,17491,17519,17573,17579,17599,17627,17669,17681,17683,17713,17737,17747,17749,17827,17839,17863,17903,17909,17911,17923,17939,17959,17971,18013,18041,18077,18089,18133,18169,18181,18191,18199,18253,18269,18307,18329,18353,18379,18413,18427,18439,18461,18481,18539,18593,18637,18671,18691,18701,18719,18731,18743,18749,18757,18773,18787,18803,18859,18899,18911,18913,19001,19013,19037,19051,19163,19181,19219,19231,19237,19249,19301,19333,19391,19403,19421,19423,19471,19477,19489,19531,19541,19543,19553,19577,19661,19681,19687,19697,19751,19759,19763,19793,19801,19813,19841,19891,19913,19973,19991,30011,30029,30059,30103,30139,30161,30197,30203,30223,30259,30271,30319,30323,30341,30367,30403,30467,30491,30517,30529,30539,30557,30593,30643,30649,30661,30703,30757,30803,30809,30851,30853,30859,30881,30911,30931,30949,30971,30983,31013,31033,31051,31063,31069,31081,31091,31121,31139,31183,31193,31223,31259,31267,31277,31307,31327,31393,31481,31513,31531,31543,31601,31627,31643,31649,31721,31723,31741,31771,31799,31859,31873,31891,31907,31957,31963,31981,31991,32009,32077,32099,32143,32173,32189,32203,32213,32233,32257,32261,32299,32303,32321,32323,32341,32353,32369,32377,32411,32423,32441,32467,32479,32491,32497,32531,32537,32563,32579,32633,32647,32687,32693,32713,32749,32783,32869,32887,32911,32933,32939,32941,32971,32983,32999,33013,33029,33049,33071,33181,33199,33223,33287,33301,33317,33329,33391,33461,33533,33589,33617,33623,33641,33751,33767,33809,33811,33857,33863,33911,33923,33931,34031,34123,34129,34141,34147,34159,34211,34267,34273,34301,34367,34469,34471,34513,34543,34549,34583,34589,34591,34603,34613,34651,34673,34687,34721,34757,34781,34807,34841,34843,34847,34897,34919,34961,34963,35027,35051,35053,35069,35083,35099,35117,35129,35141,35149,35153,35159,35201,35221,35227,35257,35267,35281,35311,35317,35323,35327,35353,35363,35381,35401,35419,35437,35447,35461,35521,35531,35537,35569,35591,35729,35753,35801,35803,35911,35969,35983,35993,36013,36037,36061,36097,36107,36109,36131,36187,36191,36209,36217,36251,36263,36269,36277,36353,36373,36467,36473,36479,36523,36541,36563,36599,36607,36721,36739,36761,36791,36809,36833,36871,36877,36913,36931,36943,36973,37021,37061,37123,37199,37201,37243,37273,37307,37309,37321,37363,37379,37409,37463,37489,37507,37547,37549,37561,37571,37573,37589,37619,37643,37781,37813,37831,37847,37889,37897,37951,37963,37991,37997,38011,38039,38053,38083,38113,38119,38183,38219,38239,38287,38327,38329,38351,38371,38377,38393,38449,38459,38543,38557,38629,38639,38651,38671,38707,38711,38723,38737,38783,38861,38867,38903,38917,38921,38923,38953,38977,38993,39047,39113,39119,39157,39161,39217,39241,39293,39313,39359,39371,39383,39397,39419,39439,39451,39461,39503,39511,39541,39581,39623,39631,39709,39749,39791,39799,39821,39827,39829,39839,39869,39877,39887,39901,39929,39953,39983,39989,70001,70009,70061,70079,70121,70141,70163,70207,70241,70249,70271,70289,70313,70327,70351,70373,70381,70439,70457,70489,70507,70529,70573,70589,70607,70639,70663,70667,70687,70717,70729,70783,70843,70913,70921,70937,70949,70951,70969,70997,70999,71069,71089,71153,71171,71209,71257,71261,71263,71293,71317,71329,71333,71347,71353,71359,71387,71389,71399,71437,71471,71503,71537,71569,71633,71707,71711,71741,71789,71899,71909,71917,71983,72047,72053,72109,72161,72221,72227,72229,72251,72253,72307,72313,72337,72341,72353,72379,72383,72461,72481,72497,72547,72551,72559,72577,72613,72671,72689,72727,72869,72871,72893,72911,73037,73063,73091,73237,73277,73291,73327,73331,73369,73417,73421,73453,73517,73523,73553,73597,73637,73681,73751,73771,73783,73819,73849,73867,73907,73939,73951,73961,74027,74047,74071,74077,74093,74131,74143,74167,74197,74201,74209,74317,74357,74377,74411,74441,74449,74453,74509,74521,74527,74561,74573,74609,74623,74747,74759,74761,74771,74843,74869,74873,74897,74941,74959,75011,75041,75167,75169,75193,75211,75217,75223,75239,75253,75289,75329,75347,75401,75407,75431,75503,75539,75541,75557,75577,75583,75611,75629,75641,75703,75721,75731,75743,75767,75781,75797,75833,75869,75913,75941,76001,76147,76157,76213,76231,76243,76253,76259,76261,76303,76343,76367,76379,76387,76403,76423,76463,76471,76487,76561,76607,76651,76667,76733,76757,76801,76819,76829,76837,76883,76919,77023,77029,77047,77081,77101,77141,77213,77237,77263,77323,77339,77347,77351,77369,77377,77383,77431,77471,77477,77491,77521,77527,77557,77587,77591,77611,77711,77797,77863,77893,77899,77977,77983,78041,78059,78139,78163,78179,78233,78259,78283,78317,78341,78367,78401,78439,78467,78487,78511,78569,78577,78607,78623,78643,78649,78691,78697,78779,78781,78787,78809,78823,78839,78887,78889,78893,78901,78929,78979,79039,79063,79103,79111,79147,79229,79231,79309,79319,79349,79379,79393,79397,79399,79411,79423,79427,79451,79531,79537,79549,79559,79589,79609,79621,79631,79669,79687,79691,79697,79757,79769,79777,79811,79841,79843,79847,79873,79889,79907,79939,79973,79997,90001,90007,90019,90023,90031,90059,90089,90121,90127,90149,90163,90199,90217,90247,90263,90271,90373,90397,90473,90499,90547,90647,90679,90697,90709,90731,90749,90793,90803,90821,90833,90863,90887,90901,90911,90917,90971,90989,91009,91019,91121,91129,91183,91193,91199,91229,91249,91283,91291,91303,91397,91453,91459,91493,91541,91571,91621,91631,91673,91711,91781,91837,91867,91921,91943,91951,91967,92003,92033,92041,92077,92119,92143,92153,92189,92219,92227,92297,92311,92317,92333,92357,92369,92381,92383,92401,92459,92479,92489,92503,92507,92639,92641,92657,92683,92707,92753,92761,92779,92789,92821,92831,92861,92867,92893,92899,92941,92959,92987,92993,93001,93083,93097,93103,93113,93139,93151,93187,93199,93239,93257,93283,93377,93407,93481,93487,93493,93503,93557,93559,93581,93601,93607,93629,93683,93701,93739,93763,93811,93871,93887,93893,93901,93911,93923,93937,93941,93971,93997,94033,94049,94109,94111,94121,94151,94153,94169,94207,94219,94261,94291,94349,94351,94397,94399,94441,94447,94483,94541,94543,94559,94573,94597,94603,94613,94649,94651,94687,94709,94723,94771,94781,94793,94837,94849,94889,94903,94907,94949,95003,95009,95087,95101,95111,95131,95143,95153,95203,95213,95231,95267,95279,95287,95317,95393,95401,95419,95429,95479,95483,95527,95539,95549,95597,95621,95731,95747,95791,95801,95803,95813,95881,95911,95929,95947,95959,95971,96001,96013,96017,96053,96149,96157,96179,96181,96221,96263,96269,96281,96289,96323,96329,96337,96377,96431,96443,96469,96517,96553,96587,96671,96697,96769,96797,96823,96827,96847,96857,96893,96907,96911,96953,97001,97007,97169,97187,97259,97327,97367,97373,97379,97381,97397,97423,97429,97441,97459,97463,97511,97523,97571,97579,97609,97651,97711,97729,97787,97789,97841,97861,97879,97961,97987,98009,98017,98081,98123,98129,98207,98221,98251,98257,98269,98299,98317,98389,98407,98411,98429,98473,98491,98507,98533,98543,98573,98597,98621,98627,98689,98711,98717,98729,98731,98779,98801,98849,98873,98887,98897,98909,98993,98999,99023,99053,99109,99119,99133,99139,99173,99181,99223,99251,99289,99317,99349,99397,99401,99409,99431,99563,99571,99611,99661,99713,99721,99793,99817,99829,99877,99881,99907,99923,99989}; int main() { cin>>l>>r; int ol=0,orr=0; for(int i=1;i<=l;i++) { if(a[i]>=l) { ol=i; break; } } for(int i=1;i<=r;i++) { if(a[i]==r) { orr=i; break; } if(a[i]>r) { orr=i-1; break; } } //cout<<ol<<" "<<orr; ///* if(ol>orr)cout<<"No"; else { for(int i=ol;i<orr;i++) { cout<<a[i]<<","; } cout<<a[orr]; } //*/ return 0; } 找出正整数 M 和 N 之间( N 不小于 M )的所有真素数。 真素数的定义:如果一个正整数 P 为素数,且其反序也为素数,那么 P 就为真素数。例如,11 ,13均为真素数,因为 11 的反序还是为 11 ,13 的反序为 31 也为素数。 输入格式 输入两个正整数 M 和 N ,空格间隔。 输出格式 按从小到大输出 M 和 N 之间(包括 M 和 N )的真素数,逗号间隔。如果之间没有真素数,则输出No。 样例输入 1 10 35 样例输出 1 11,13,17,31 样例输入 2 14 15 样例输出 2 No N,M<=100000 #DEBUG
最新发布
12-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值