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