[RAPPS] add a layer of window above the richedit (#2871)

* add one more layer of window
* use ATL to create window
* set pLink to NULL to avoid wild pointer
This commit is contained in:
He Yang 2020-06-05 23:32:08 +08:00 committed by Mark Jansen
parent 88cdb9696b
commit eacaf65459
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
4 changed files with 171 additions and 58 deletions

View file

@ -71,7 +71,7 @@ VOID CopyTextToClipboard(LPCWSTR lpszText)
CloseClipboard();
}
VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem)
{
HMENU hMenu = NULL;
HMENU hPopupMenu;
@ -102,7 +102,7 @@ VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
GetCursorPos(&pt);
SetForegroundWindow(hwnd);
TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hMainWnd, NULL);
TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hwndOwner, NULL);
if (hMenu)
{
@ -110,6 +110,12 @@ VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
}
}
VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
{
ShowPopupMenuEx(hwnd, hMainWnd, MenuID, DefaultItem);
}
BOOL StartProcess(ATL::CStringW &Path, BOOL Wait)
{
return StartProcess(const_cast<LPWSTR>(Path.GetString()), Wait);;