Author: gadamopoulos
Date: Fri Jun 9 09:16:44 2017
New Revision: 74972
URL:
http://svn.reactos.org/svn/reactos?rev=74972&view=rev
Log:
[EXPLORER] -Use WM_POPUPSYSTEMMENU to open the system menu of a window. CORE-13400
Modified:
trunk/reactos/base/shell/explorer/taskswnd.cpp
Modified: trunk/reactos/base/shell/explorer/taskswnd.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/tasksw…
==============================================================================
--- trunk/reactos/base/shell/explorer/taskswnd.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/taskswnd.cpp [iso-8859-1] Fri Jun 9 09:16:44 2017
@@ -1532,21 +1532,14 @@
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
{
-
- HMENU hmenu = ::GetSystemMenu(TaskItem->hWnd, FALSE);
-
- if (hmenu)
- {
- POINT pt;
- int cmd;
- GetCursorPos(&pt);
- cmd = TrackPopupMenu(hmenu, TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_RETURNCMD,
pt.x, pt.y, 0, m_TaskBar.m_hWnd, NULL);
- if (cmd)
- {
- SetForegroundWindow(TaskItem->hWnd); // reactivate window after the
context menu has closed
- ::PostMessage(TaskItem->hWnd, WM_SYSCOMMAND, cmd, 0);
- }
- }
+ POINT pt;
+ GetCursorPos(&pt);
+
+ SetForegroundWindow(TaskItem->hWnd);
+
+ ActivateTask(TaskItem->hWnd);
+
+ ::SendMessageW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x,
pt.y));
}
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)