Loop through MFC Child Dialogs, MDIFrames etc

2019-05-28 23:57发布

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?

标签: c++ mfc
2条回答
我只想做你的唯一
2楼-- · 2019-05-29 00:24

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

查看更多
We Are One
3楼-- · 2019-05-29 00:43

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.
}
查看更多
登录 后发表回答