This fix is needed for the Delphi GUI programs.
- Don't enumerate the windows whose owner window exists.
- Use PostMessage SC_RESTORE instead of ShowWindowAsync SW_RESTORE.
CORE-15165
void MakeWindowActive(HWND hwnd)
{
if (IsIconic(hwnd))
void MakeWindowActive(HWND hwnd)
{
if (IsIconic(hwnd))
- ShowWindowAsync(hwnd, SW_RESTORE);
+ PostMessageW(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
BringWindowToTop(hwnd); // same as: SetWindowPos(hwnd,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); ?
SetForegroundWindow(hwnd);
BringWindowToTop(hwnd); // same as: SetWindowPos(hwnd,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); ?
SetForegroundWindow(hwnd);
if (!IsWindowVisible(window))
return TRUE;
if (!IsWindowVisible(window))
return TRUE;
+ if (GetWindow(window, GW_OWNER) != NULL)
+ return TRUE;
+
GetClassNameW(window, windowText, _countof(windowText));
if ((wcscmp(L"Shell_TrayWnd", windowText)==0) ||
(wcscmp(L"Progman", windowText)==0) )
GetClassNameW(window, windowText, _countof(windowText));
if ((wcscmp(L"Shell_TrayWnd", windowText)==0) ||
(wcscmp(L"Progman", windowText)==0) )