|
-
March 31st, 1999, 02:05 AM
#1
Re: Disable Main Frame Close and resize
To prevent resize, move etc:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// Create a window without min/max buttons or sizable border
cs.style = WS_POPUPWINDOW;
return CFrameWnd::PreCreateWindow(cs);
}
to handle closing:
Add an handler for WM_CLOSE (ClassWizard -> CMainFrame -> Close).
There you can handle a close request.
At last:
Preventing shutdown:
BOOL CMainFrame::OnQueryEndSession()
{
if (!CFrameWnd::OnQueryEndSession())
return FALSE;
if (AfxMessageBox(GetResText(IDS_END_ABFRAGE),MB_OKCANCEL) == IDCANCEL)
return FALSE;
return TRUE;
}
But if you wait too long in the messagebox the shutdown will continue because windows assumes your applikcation is
dead. So maybe use a non-modal box with a timer for a time limit.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|