Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loop through MFC Child Dialogs, MDIFrames etc

Tags:

c++

mfc

Is there a way to loop through all MFC Child Dialogs, MDI frames and etc? And is there a way to find out which dialog or window I am looping through?

like image 878
faya Avatar asked Sep 19 '25 00:09

faya


2 Answers

Taken from Анатолий Тутов (https://web.archive.org/web/20140110220804/http://www.asis.ru/posts/27):

for (CWnd *pWnd = GetWindow(GW_CHILD);  pWnd != NULL;  pWnd = pWnd->GetNextWindow(GW_HWNDNEXT))
{
    //Insert your code here. pWnd is a pointer to control window.
}
like image 109
Oliver Zendel Avatar answered Sep 20 '25 16:09

Oliver Zendel


You could use EnumChildWindows to iterate through child windows of certain window.

like image 34
Kirill V. Lyadvinsky Avatar answered Sep 20 '25 14:09

Kirill V. Lyadvinsky