失去焦点时,还原框架菜单。
使用向MDI客户区窗口发送WM_MDISETMENU或WM_MDISETMENU消息。
wParam为菜单句柄,lParam为欲添加窗口列表的子菜单句柄
case WM_MDIACTIVATE: //激活时,设置框架菜单 if (lParam == (LPARAM) hwnd) SendMessage (hwndClient, WM_MDISETMENU, (WPARAM) hMenuHello, (LPARAM) hMenuHelloWindow) ; //失去焦点时,将框架菜单还原 if (lParam != (LPARAM) hwnd) SendMessage (hwndClient, WM_MDISETMENU, (WPARAM) hMenuInit, (LPARAM) hMenuInitWindow) ; DrawMenuBar (hwndFrame) ; //注: hwndFrame的得到方法: //hwndClient = GetParent (hwnd) ; //hwndFrame = GetParent (hwndClient) ; return 0 ;