CWnd *pPrevHwnd=NULL;
pPrevHwnd=CWnd::GetDesktopWindow()->GetWindow(GW_CHILD);
while(*pPrevHwnd)
{
.
.
.
pPrevHwnd=pPrevHwnd->GetWindow(GW_HWNDNEXT);
}
pPrevHwnd=CWnd::GetDesktopWindow()->GetWindow(GW_CHILD);
while(*pPrevHwnd)
{
.
.
.
pPrevHwnd=pPrevHwnd->GetWindow(GW_HWNDNEXT);
}
while (::IsWindow(hWndPrevious)) // 找到的话作自己的操作
{
// 继续寻找下一个窗口
hWndPrevious = ::GetWindow(hWndPrevious,GW_HWNDNEXT);
}