mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
parent
ecd51d99f4
commit
3fd2deefac
1 changed files with 17 additions and 8 deletions
|
@ -165,13 +165,15 @@ void CompleteSwitch(BOOL doSwitch)
|
||||||
BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
|
BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HICON hIcon;
|
HICON hIcon;
|
||||||
|
HWND hwndOwner;
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(lParam);
|
UNREFERENCED_PARAMETER(lParam);
|
||||||
|
|
||||||
if (!IsWindowVisible(window))
|
if (!IsWindowVisible(window))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (GetWindow(window, GW_OWNER) != NULL)
|
hwndOwner = GetWindow(window, GW_OWNER);
|
||||||
|
if (hwndOwner && IsWindowVisible(hwndOwner))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
GetClassNameW(window, windowText, _countof(windowText));
|
GetClassNameW(window, windowText, _countof(windowText));
|
||||||
|
@ -216,16 +218,23 @@ BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function mostly compatible with the normal EnumWindows,
|
// Function mostly compatible with the normal EnumChildWindows,
|
||||||
// except it lists in Z-Order and it doesn't ensure consistency
|
// except it lists in Z-Order and it doesn't ensure consistency
|
||||||
// if a window is removed while enumerating
|
// if a window is removed while enumerating
|
||||||
void EnumWindowsZOrder(WNDENUMPROC callback, LPARAM lParam)
|
void EnumChildWindowsZOrder(HWND hwnd, WNDENUMPROC callback, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HWND next = GetTopWindow(NULL);
|
HWND next = GetTopWindow(hwnd);
|
||||||
while (next != NULL)
|
while (next != NULL)
|
||||||
{
|
{
|
||||||
|
if (!hwnd && !IsWindowVisible(next))
|
||||||
|
{
|
||||||
|
// UPDATE: Seek also the owned windows of the hidden top-level window.
|
||||||
|
EnumChildWindowsZOrder(next, callback, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
if (!callback(next, lParam))
|
if (!callback(next, lParam))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
next = GetWindow(next, GW_HWNDNEXT);
|
next = GetWindow(next, GW_HWNDNEXT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -413,7 +422,7 @@ BOOL ProcessHotKey(VOID)
|
||||||
if (!isOpen)
|
if (!isOpen)
|
||||||
{
|
{
|
||||||
windowCount=0;
|
windowCount=0;
|
||||||
EnumWindowsZOrder(EnumerateCallback, 0);
|
EnumChildWindowsZOrder(NULL, EnumerateCallback, 0);
|
||||||
|
|
||||||
if (windowCount < 2)
|
if (windowCount < 2)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -507,7 +516,7 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam )
|
||||||
Esc = TRUE;
|
Esc = TRUE;
|
||||||
|
|
||||||
windowCount = 0;
|
windowCount = 0;
|
||||||
EnumWindowsZOrder(EnumerateCallback, 0);
|
EnumChildWindowsZOrder(NULL, EnumerateCallback, 0);
|
||||||
|
|
||||||
if (windowCount < 2)
|
if (windowCount < 2)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue