mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
parent
a882ec7a02
commit
58825de892
1 changed files with 28 additions and 3 deletions
|
@ -709,8 +709,9 @@ public:
|
|||
IN BOOL TrackUp,
|
||||
IN PVOID Context OPTIONAL)
|
||||
{
|
||||
INT x = ppt->x;
|
||||
INT y = ppt->y;
|
||||
POINT pt;
|
||||
TPMPARAMS params;
|
||||
RECT rc;
|
||||
HRESULT hr;
|
||||
UINT uCommand;
|
||||
HMENU popup = CreatePopupMenu();
|
||||
|
@ -718,6 +719,17 @@ public:
|
|||
if (popup == NULL)
|
||||
return E_FAIL;
|
||||
|
||||
if (ppt)
|
||||
{
|
||||
pt = *ppt;
|
||||
}
|
||||
else
|
||||
{
|
||||
::GetWindowRect(m_hWnd, &rc);
|
||||
pt.x = rc.left;
|
||||
pt.y = rc.top;
|
||||
}
|
||||
|
||||
TRACE("Before Query\n");
|
||||
hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
|
||||
if (FAILED_UNEXPECTEDLY(hr))
|
||||
|
@ -728,7 +740,20 @@ public:
|
|||
}
|
||||
|
||||
TRACE("Before Tracking\n");
|
||||
uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, x, y, m_hWnd, NULL);
|
||||
::SetForegroundWindow(m_hWnd);
|
||||
if (hwndExclude)
|
||||
{
|
||||
::GetWindowRect(hwndExclude, &rc);
|
||||
ZeroMemory(¶ms, sizeof(params));
|
||||
params.cbSize = sizeof(params);
|
||||
params.rcExclude = rc;
|
||||
uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, ¶ms);
|
||||
}
|
||||
else
|
||||
{
|
||||
uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, NULL);
|
||||
}
|
||||
::PostMessage(m_hWnd, WM_NULL, 0, 0);
|
||||
|
||||
if (uCommand != 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue