removing the Main Frame title bar in a SDI
-
Does any body knows how to remove the title bar and the menu from the main frame window in an SDI application with MFC ??? k_dehairy
I think that requires removal of the
WS_CAPTION
andWS_SYSMENU
styles. However, I think there is more to it than this, but I've not tried.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
I think that requires removal of the
WS_CAPTION
andWS_SYSMENU
styles. However, I think there is more to it than this, but I've not tried.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
Does any body knows how to remove the title bar and the menu from the main frame window in an SDI application with MFC ??? k_dehairy
As luck would have it, I'm working on an application that does exactly that. Happy to share... All code is in the CFrameWnd derived class. to remove the menu and title bar:
// remove and destroy the old menu SetMenu(NULL); ::DestroyMenu(m_hMenuDefault); m_hMenuDefault = NULL; // remove the title bar ModifyStyle(WS_CAPTION, 0);
to put them back:// restore the title bar ModifyStyle(0, WS_CAPTION); // recreate the menu CMenu menu; menu.LoadMenu(IDR_MAINFRAME); SetMenu(&menu); m_hMenuDefault = menu.GetSafeHmenu();
-
As luck would have it, I'm working on an application that does exactly that. Happy to share... All code is in the CFrameWnd derived class. to remove the menu and title bar:
// remove and destroy the old menu SetMenu(NULL); ::DestroyMenu(m_hMenuDefault); m_hMenuDefault = NULL; // remove the title bar ModifyStyle(WS_CAPTION, 0);
to put them back:// restore the title bar ModifyStyle(0, WS_CAPTION); // recreate the menu CMenu menu; menu.LoadMenu(IDR_MAINFRAME); SetMenu(&menu); m_hMenuDefault = menu.GetSafeHmenu();
I guess I am lucky !! .. thanks very much but.. I put the code in the OnCreate() in the CFrameWnd derived class. It worked with the menu. For the title bar it became not functioning but still here, visible. Why is that? and again thank you --------------------------------- I just tried this now It worked when I made a call to SetWindowPos() but Why is that? k_dehairy