mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[EXPLORER] Send WM_POPUPSYSTEMMENU asynchronously (#4047)
- Delete useless SendMessageTimeout:WM_NULL call. - Add useful SendMessageCallbackW:WM_POPUPSYSTEMMENU call. - In the callback function of SendMessageCallbackW, do PostMessageW:WM_NULL to properly handle the popup menu. CORE-16353
This commit is contained in:
parent
46fbc6f432
commit
037c744eb1
1 changed files with 7 additions and 5 deletions
|
@ -1630,6 +1630,11 @@ public:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static VOID CALLBACK
|
||||
SendAsyncProc(HWND hwnd, UINT uMsg, DWORD_PTR dwData, LRESULT lResult)
|
||||
{
|
||||
::PostMessageW(hwnd, WM_NULL, 0, 0);
|
||||
}
|
||||
|
||||
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
|
||||
{
|
||||
|
@ -1640,14 +1645,11 @@ public:
|
|||
|
||||
ActivateTask(TaskItem->hWnd);
|
||||
|
||||
/* Wait up to 2 seconds for the window to process the foreground notification. */
|
||||
DWORD_PTR resultDummy;
|
||||
if (!SendMessageTimeout(TaskItem->hWnd, WM_NULL, 0, 0, 0, 2000, &resultDummy))
|
||||
ERR("HandleTaskItemRightClick detected the window was unresponsive for 2 seconds, or was destroyed\n");
|
||||
if (GetForegroundWindow() != TaskItem->hWnd)
|
||||
ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
|
||||
|
||||
::SendMessageW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y));
|
||||
::SendMessageCallbackW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y),
|
||||
SendAsyncProc, (ULONG_PTR)TaskItem);
|
||||
}
|
||||
|
||||
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)
|
||||
|
|
Loading…
Reference in a new issue