|
-
April 9th, 1999, 07:11 AM
#1
Disabling 'CLOSE' button
I've a SDI application which I wonder how can I disable the 'CLOSE' button located at the top right hand corner of the application during run-time.
Thanks for any suggestion.
-
April 9th, 1999, 07:28 AM
#2
Re: Disabling 'CLOSE' button
Add a return statement to OnClose() function of CMainFrame (or whatever) so that the default CMainFrame::OnClose() does not get called.
If you don't have an OnClose() function use class wizard to add a handler for WM_CLOSE.
-
April 9th, 1999, 07:30 AM
#3
Re: Disabling 'CLOSE' button
Alternatively, you may be able to modify the
CREATESTRUCT structure in PreCreateWindow().
-
April 9th, 1999, 10:03 AM
#4
Re: Disabling 'CLOSE' button
Place this code at any place (but window must be already created)
It will disable ur close button.
CMenu *pSysMenu = (CMenu*)AfxGetMainWnd()->GetSystemMenu(FALSE);
pSysMenu->DeleteMenu(SC_CLOSE, MF_BYCOMMAND);
AfxGetMainWnd()->PostMessage(WM_NCACTIVATE);
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
|