-
DrawMenuBar
鎖定
DrawMenuBar是一個計算機函數,功能是該函數重畫指定菜單的菜單條。
- 外文名
- DrawMenuBar
- 適用領域
- 計算機,編程,API
- 應用學科
- 數學
- 函數原型
- BOOL DrawMenuBar(HWND hWnd)
如果系統創建窗口以後菜單條被修改,則必須調用此函數來畫修改了的菜單條。
函數原型:BOOL DrawMenuBar(HWND hWnd);
參數:
hWnd:其菜單條需要被重畫的窗口的句柄。
速查:Windows NT:及以上版本;Windows:95及以上版本;Windows:2.0及以上版本;頭文件:winuser.h;輸入庫:user32.lib。
示例:
void CMainFrame::OnCwndDeletefilemenu()
{
// This example deletes the leftmost popup menu or leftmost
// popup menu item from the application's main window.
CWnd* pMain = AfxGetMainWnd();
// The main window _can_ be NULL, so this code
// doesn't ASSERT and actually tests.
if (pMain != NULL)
{
// Get the main window's menu
CMenu* pMenu = pMain->GetMenu();
// If there is a menu and it has items, we'll
// delete the first one.
if (pMenu != NULL && pMenu->GetMenuItemCount() > 0)
{
pMenu->DeleteMenu(0, MF_BYPOSITION);
// force a redraw of the menu bar
pMain->DrawMenuBar();
}
// No need to delete pMenu because it is an MFC
// temporary object.
}
}
- 詞條統計
-
- 瀏覽次數:次
- 編輯次數:7次歷史版本
- 最近更新: Da73gz4