how to close all child windows in MDI?
-
how to close all child windows in MDI? like the VC->windows->Close All command
-
how to close all child windows in MDI? like the VC->windows->Close All command
EnumChildWindows maybe helpful. life is like a box of chocolate,you never know what you r going to get.
-
how to close all child windows in MDI? like the VC->windows->Close All command
CMDIChildWnd *pMDIActive; while( pMDIActive = MDIGetActive() ) { pMDIActive->SendMessage(WM_CLOSE); } Regards, Ram
-
how to close all child windows in MDI? like the VC->windows->Close All command
yes,I did it with following code: BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam) { ::SendMessage(hwndChild,WM_CLOSE,0,0); return TRUE; } void CMainFrame::OnWindowCloseall() { // TODO: 在此添加命令处理程序代码 ::EnumChildWindows(m_hWndMDIClient,EnumChildProc,0); } life is like a box of chocolate,you never know what you r going to get.
-
yes,I did it with following code: BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam) { ::SendMessage(hwndChild,WM_CLOSE,0,0); return TRUE; } void CMainFrame::OnWindowCloseall() { // TODO: 在此添加命令处理程序代码 ::EnumChildWindows(m_hWndMDIClient,EnumChildProc,0); } life is like a box of chocolate,you never know what you r going to get.
thank you for your reply. I found anoter function:
CDocTemplate* pTemplate = pDocument->GetDocTemplate(); pTemplate->CloseAllDocuments(true);
though I don't know the progress of the function. -
thank you for your reply. I found anoter function:
CDocTemplate* pTemplate = pDocument->GetDocTemplate(); pTemplate->CloseAllDocuments(true);
though I don't know the progress of the function.zeus_master wrote:
pTemplate->CloseAllDocuments(true);
I'm glad you found this. I can't believe that
EnumChildWindows()
andSendMessage()
were suggested.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb