|
-
April 1st, 1999, 09:43 AM
#1
How Do I Disable Close Window X?
I have a CToolBar which when dragged from its docking position, becomes a window.
It displayes that little cross 'fella' in the corner to close it.
I want to disable this. I had assumed that I could create it without one but I dont know how. I notice in Visual studio the toolbar close facilty (X) is disable How do I do that?
-
April 2nd, 1999, 05:24 AM
#2
Re: How Do I Disable Close Window X?
Try following.
First, get system menu from floating window,
then disable close button.
Here is a tiny code and they work for all windows with system menu.
CMenu *pSysMenu = (CMenu*)pMiniFrame->GetSystemMenu(FALSE);
pSysMenu->DeleteMenu(SC_CLOSE, MF_BYCOMMAND);
Good Luck. 
Walter I An
-
April 7th, 1999, 10:42 AM
#3
Re: How Do I Disable Close Window X?
CMenu *pSysMenu = (CMenu*) (&m_wndToolBar2)->GetSystemMenu(FALSE);
pSysMenu->DeleteMenu(SC_CLOSE, MF_BYCOMMAND);
This creates an exception. Probably because the window is not originally created as floating. So it doesnot have a system menu. How do I only call this once the window floats?
In otherwords what message can I capture that tells me when the window is made to float.
Simon Pettman
-
April 7th, 1999, 11:19 AM
#4
Re: How Do I Disable Close Window X?
Hi
You can see the answer at CodeGuru Home Page.
In Home Page, there is title "Other Source Code Section". Select "dialog". And then search the title "Menu Handling". Under "Menu Handling" there is a subject "Disable close button for Dialog Box" by Rajesh Rarikh. You can study and enjoy.
AntHtoo Naing
-
April 9th, 1999, 01:35 AM
#5
Re: How Do I Disable Close Window X?
U are right!
U need to check this when Ur window is not docked.
There is a function called "IsFloating()"
in CControlBar.
Good luck. 
Walter An
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
|