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?
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());
}
Re: Determine if any documents open in MDI
Hi,
After u change your document's content, call "UpdateAllViews". :)
Re: Determine if any documents open in MDI
Thanks a lot. works like a dream.