Window Style
-
I Override The PreCreateWindow Func BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; cs.style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |WS_MAXIMIZEBOX|WS_MAXIMIZE; return TRUE; } And I want The Restore Button To Be Disabled i Removed The WS_MAXIMIZEBOX style but the resulting window covers the task bar and i don't want that. I just Like the size the window has when using the above settings combinations but don't want the window to be resized by cliking the restore or double clicking on the title bar Is There any way i can catch this using the WM_WINDOWPOSCHANGING,WM_NCCALCSIZE,WM_WINDOWPOSCHANGED or WM_SIZE
-
I Override The PreCreateWindow Func BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; cs.style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX |WS_MAXIMIZEBOX|WS_MAXIMIZE; return TRUE; } And I want The Restore Button To Be Disabled i Removed The WS_MAXIMIZEBOX style but the resulting window covers the task bar and i don't want that. I just Like the size the window has when using the above settings combinations but don't want the window to be resized by cliking the restore or double clicking on the title bar Is There any way i can catch this using the WM_WINDOWPOSCHANGING,WM_NCCALCSIZE,WM_WINDOWPOSCHANGED or WM_SIZE
use following code: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (BaseClass::OnCreate(lpCreateStruct) == -1) return -1; // Do something // Remove positions of menu CMenu* pTopMenu = GetSystemMenu(FALSE); if(pTopMenu != NULL) { pTopMenu -> RemoveMenu(SC_SIZE, MF_BYCOMMAND); //remove resizeing pTopMenu -> RemoveMenu(SC_MOVE, MF_BYCOMMAND); //remove Moveing pTopMenu -> RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND); //remove Maximizing } return 0; }
-
use following code: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (BaseClass::OnCreate(lpCreateStruct) == -1) return -1; // Do something // Remove positions of menu CMenu* pTopMenu = GetSystemMenu(FALSE); if(pTopMenu != NULL) { pTopMenu -> RemoveMenu(SC_SIZE, MF_BYCOMMAND); //remove resizeing pTopMenu -> RemoveMenu(SC_MOVE, MF_BYCOMMAND); //remove Moveing pTopMenu -> RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND); //remove Maximizing } return 0; }