From 8fe7e083b31a496bdd4a328b78ca4e276592bdfb Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Thu, 26 Feb 2004 20:20:44 +0000 Subject: [PATCH] fix foreground window handling when clicking on notification area icons svn path=/trunk/; revision=8407 --- .../system/explorer/taskbar/traynotify.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/reactos/subsys/system/explorer/taskbar/traynotify.cpp b/reactos/subsys/system/explorer/taskbar/traynotify.cpp index 10eee1a68d7..8d8670c3f70 100644 --- a/reactos/subsys/system/explorer/taskbar/traynotify.cpp +++ b/reactos/subsys/system/explorer/taskbar/traynotify.cpp @@ -185,17 +185,21 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) // Notify the message if the owner is still alive if (IsWindow(entry._hWnd)) { - // allow SetForegroundWindow() in Client Process - DWORD processId; - GetWindowThreadProcessId(entry._hWnd, &processId); + if (nmsg == WM_MOUSEMOVE) // avoid to call blocking SendMessage() for merely moving the mouse over icons + PostMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg); + else { + // allow SetForegroundWindow() in client process + DWORD processId; + GetWindowThreadProcessId(entry._hWnd, &processId); - // bind dynamically to AllowSetForegroundWindow() to be compatible to WIN98 - static DynamicFct AllowSetForegroundWindow(TEXT("USER32"), "AllowSetForegroundWindow"); + // bind dynamically to AllowSetForegroundWindow() to be compatible to WIN98 + static DynamicFct AllowSetForegroundWindow(TEXT("USER32"), "AllowSetForegroundWindow"); - if (AllowSetForegroundWindow) - (*AllowSetForegroundWindow)(processId); + if (AllowSetForegroundWindow) + (*AllowSetForegroundWindow)(processId); - PostMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg); + SendMessage(entry._hWnd, entry._uCallbackMessage, entry._uID, nmsg); + } } else if (_icon_map.erase(entry)) // delete icons without valid owner window Refresh();