for( hwnd = GetWindow( GetDesktopWindow(), GW_CHILD ); NULL != hwnd; hwnd = GetWindow( hwnd, GW_HWNDNEXT ) ) { if( IsWindow( hwnd ) && IsWindowVisible( hwnd ) && (style = GetWindowStyle( hwnd ) & WS_CAPTION) == WS_CAPTION && !(style & WS_POPUP) ) { // ウィンドウハンドル列挙 } }