Get child window's handles(HWND)
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
hello.......how to get Child frame's handles from Main frame in MDI application? Thanxs..... C.R.Naik
You can use code similar to this. Basically, you go through each of the application document templates, to get each of the open documents. For each document (which could have multiple views), you go through each of the views, and then get the parent frame.
POSITION posTemplate = theApp.GetFirstDocTemplatePosition(); while (posTemplate) { CDocTemplate * pTemplate = theApp.GetNextDocTemplate(posTemplate); POSITION posDocument = pTemplate->GetFirstDocPosition(); while (posDocument) { CDocument * pDocument = pTemplate->GetNextDoc(posDocument); POSITION posView = pDocument->GetFirstViewPosition(); if (posView) { CView * pView = (CSpecExView *)pSpecExDoc->GetNextView(posView); CFrameWnd * pChildFrame = pView->GetParentFrame(); } } }
Hope this helps!