MDI Window List
-
Ensure that your menu has none of the following items:
ID_WINDOW_NEW
ID_WINDOW_ARRANGE
ID_WINDOW_CASCADE
ID_WINDOW_TILE_HORZ
ID_WINDOW_TILE_VERT
ID_WINDOW_SPLITMFC searches through your menu (in CMDIChildWnd::OnUpdateFrameMenu) and uses the rightmost popup containing one of these items as Window menu - the one that gets the window list. Tomasz Sowinski -- http://www.shooltz.com.pl
-
Ensure that your menu has none of the following items:
ID_WINDOW_NEW
ID_WINDOW_ARRANGE
ID_WINDOW_CASCADE
ID_WINDOW_TILE_HORZ
ID_WINDOW_TILE_VERT
ID_WINDOW_SPLITMFC searches through your menu (in CMDIChildWnd::OnUpdateFrameMenu) and uses the rightmost popup containing one of these items as Window menu - the one that gets the window list. Tomasz Sowinski -- http://www.shooltz.com.pl
-
I don't even have a Window menu... MFC places it on the bottom of my second-last menu... Even if this menu's name is "Test" for example... and my menu items names "Test1", "Test2", ... The Window list is put always on the bottom of them...
Do you understand the difference between menu item name and menu item ID? Changing the names will not help. If you have menu containing items with identifiers like ID_WINDOW_xxx, the window list will be appended. You have to change menu item identifiers. Tomasz Sowinski -- http://www.shooltz.com.pl
-
Do you understand the difference between menu item name and menu item ID? Changing the names will not help. If you have menu containing items with identifiers like ID_WINDOW_xxx, the window list will be appended. You have to change menu item identifiers. Tomasz Sowinski -- http://www.shooltz.com.pl
I do! I don't have a menu which has an ID that starts with ID_WINDOW_ ... As a matter of fact, MFC puts the window list on the "Test" menu's bottom... Which has the ID's: ID_TEST_TEST1 and ID_TEST_TEST2. My Child windows are created through the CMDIChildWnd class' Create method... CSettingsDlg m_settDlg; // Derived from CMDIChildWnd m_settDlg.Create(AfxRegisterWndClass(0, 0, (HBRUSH)COLOR_WINDOW), title, WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU, r); m_settDlg.ShowWindow(SW_SHOW);
-
I do! I don't have a menu which has an ID that starts with ID_WINDOW_ ... As a matter of fact, MFC puts the window list on the "Test" menu's bottom... Which has the ID's: ID_TEST_TEST1 and ID_TEST_TEST2. My Child windows are created through the CMDIChildWnd class' Create method... CSettingsDlg m_settDlg; // Derived from CMDIChildWnd m_settDlg.Create(AfxRegisterWndClass(0, 0, (HBRUSH)COLOR_WINDOW), title, WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU, r); m_settDlg.ShowWindow(SW_SHOW);
Put the breakpoint in the line 871 of the file WINMDI.CPP located in vc98\mfc\src directory. The line contains this code: return hMenuPop; If your programs stops there, it means one of the following: 1) your menu has some ID_WINDOW_xxx id. 2) your ID_TEST ids have the same value as ID_WINDOW_xxx ones. If breakpoints is not hit and you can see window list in your menu, something strange is going on... Tomasz Sowinski -- http://www.shooltz.com.pl
-
Put the breakpoint in the line 871 of the file WINMDI.CPP located in vc98\mfc\src directory. The line contains this code: return hMenuPop; If your programs stops there, it means one of the following: 1) your menu has some ID_WINDOW_xxx id. 2) your ID_TEST ids have the same value as ID_WINDOW_xxx ones. If breakpoints is not hit and you can see window list in your menu, something strange is going on... Tomasz Sowinski -- http://www.shooltz.com.pl
-
The debugger doesn't even stop at the start of this function... It is never executed! And my ID-values are different :confused: I think I'm going crazy here X|
Did you override CMDIFrameWnd::OnUpdateFrameMenu or CMDIChildWnd::OnUpdateFrameMenu in your program? Or maybe you're explicitly calling CMDIFrameWnd::MDISetMenu? Tomasz Sowinski -- http://www.shooltz.com.pl
-
Did you override CMDIFrameWnd::OnUpdateFrameMenu or CMDIChildWnd::OnUpdateFrameMenu in your program? Or maybe you're explicitly calling CMDIFrameWnd::MDISetMenu? Tomasz Sowinski -- http://www.shooltz.com.pl
-
Nope, non of these three... If you have a few seconds time, I have send you a VERY small test-case (created within a few minutes from scratch using the MFC wizard) by mail (If you're upset for this, I'm sorry, but I'm quite desperate)...
OK, that was easy. Your app doesn't use doc/view architecture. To disable window menu, override OnCreateClient in your CMainFrame class, and put the following code inside:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
return CreateClient(lpcs, NULL);
}Just pass NULL as second parameter to CreateClient - this means that you don't want the Window menu. Tomasz Sowinski -- http://www.shooltz.com.pl
-
OK, that was easy. Your app doesn't use doc/view architecture. To disable window menu, override OnCreateClient in your CMainFrame class, and put the following code inside:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
return CreateClient(lpcs, NULL);
}Just pass NULL as second parameter to CreateClient - this means that you don't want the Window menu. Tomasz Sowinski -- http://www.shooltz.com.pl
-
OK, that was easy. Your app doesn't use doc/view architecture. To disable window menu, override OnCreateClient in your CMainFrame class, and put the following code inside:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
return CreateClient(lpcs, NULL);
}Just pass NULL as second parameter to CreateClient - this means that you don't want the Window menu. Tomasz Sowinski -- http://www.shooltz.com.pl
Can you please tell me how to hide/delete the window popup menu from the main menu if I am working with Doc/ View application? Thats really urgent, I am using the code like CMenu *menuVault = this->GetMenu(); ::DeleteMenu(menuVault->GetSafeHmenu(),9,MF_BYPOSITION);//9 is the position of Wondows menu ::DrawMenuBar(::AfxGetMainWnd()->m_hWnd);, everything seems to be ok but menu bar is not getting refreshed or redrawn..... what could be worng????
Never complain,never explain,just do your work.