faya
faya

Reputation: 5725

Loop through MFC Child Dialogs, MDIFrames etc

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?

Upvotes: 4

Views: 4017

Answers (2)

Kirill V. Lyadvinsky
Kirill V. Lyadvinsky

Reputation: 99635

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

Upvotes: 6

Oliver Zendel
Oliver Zendel

Reputation: 2901

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.
}

Upvotes: 7

Related Questions