leigh2
asked on
MDI Child Frame with no system exit button
I have a MDI application in which I have multiple views. However upon loading the application a default view is displayed and I don't want the user to be able to close this view. Is it possible to remove the "x" exit button from the frame?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This method was a good idea but unfortunately did not work. Thanks for your help anyways. You cannot create a child with ~WM_CLOSE.
Regards, Leigh
Regards, Leigh
ASKER
Thanks this looks like it will work fine. Do you know how I could tell what window not to close?
thanks,leigh2....
Style to WM_NOCLOSE.
May be by overloading PreCreateWindow
BOOL CMainFrame::PreCreateWindo
{
// Create a window without min/max buttons or sizable border
cs.style = WS_OVERLAPPED | WS_SYSMENU | WS_BORDER | WM_NOCLOSE;
// Size the window to 1/3 screen size and center it
cs.cy = ::GetSystemMetrics(SM_CYSC
cs.cx = ::GetSystemMetrics(SM_CXSC
cs.y = ((cs.cy * 3) - cs.cy) / 2;
cs.x = ((cs.cx * 3) - cs.cx) / 2;
// Call the base-class version
return CFrameWnd::PreCreateWindow
}