|
-
August 3rd, 2006, 09:32 PM
#1
Determine if any documents open in MDI
Hi gurus,
I'm new to writing a MDI program and was wondering how to determine if any documents are currently open from CMainFrame.
I need this because I am trying to disable a tool bar when the mainframe window is empty.
Also, which windows message do I need to use to know when the active document has changed?
-
August 3rd, 2006, 10:21 PM
#2
Re: Determine if any documents open in MDI
Add an ON_UPDATE_COMMAND_UI handler for the toolbar item you want to disable and in the handler, do this:
Code:
void CMainFrame::OnUpdateYourToolBarButtonID(CCmdUI* pCmdUI)
{
pCmdUI->Enable(NULL != MDIGetActive());
}
-
August 4th, 2006, 01:23 AM
#3
Re: Determine if any documents open in MDI
Hi,
After u change your document's content, call "UpdateAllViews".
-
August 4th, 2006, 02:40 AM
#4
Re: Determine if any documents open in MDI
Thanks a lot. works like a dream.
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
|