[RAPPS] Show listview context menu when the keyboard menu button/Shift+F10 is pressed (#5620)

This commit is contained in:
Whindmar Saksit 2024-08-31 18:30:45 +02:00 committed by GitHub
parent 0197a5bcae
commit 163f3407c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 13 deletions

View file

@ -40,7 +40,7 @@ CopyTextToClipboard(LPCWSTR lpszText)
}
VOID
ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem)
ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem, POINT *Point)
{
HMENU hMenu = NULL;
HMENU hPopupMenu;
@ -68,10 +68,13 @@ ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem)
SetMenuDefaultItem(hPopupMenu, DefaultItem, FALSE);
}
GetCursorPos(&pt);
if (!Point)
{
GetCursorPos(Point = &pt);
}
SetForegroundWindow(hwnd);
TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hwndOwner, NULL);
TrackPopupMenu(hPopupMenu, 0, Point->x, Point->y, 0, hwndOwner, NULL);
if (hMenu)
{