mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:05:52 +00:00
implemented context menu for file child windows
svn path=/trunk/; revision=7969
This commit is contained in:
parent
c9e333fafc
commit
4d326b81dc
1 changed files with 20 additions and 0 deletions
|
@ -410,6 +410,26 @@ LRESULT FileChildWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
|
||||
return TRUE;}
|
||||
|
||||
case WM_CONTEXTMENU: {
|
||||
// first select the current item in the listbox
|
||||
HWND hpanel = (HWND) wparam;
|
||||
POINTS& pos = MAKEPOINTS(lparam);
|
||||
POINT pt; POINTSTOPOINT(pt, pos);
|
||||
ScreenToClient(hpanel, &pt);
|
||||
SendMessage(hpanel, WM_LBUTTONDOWN, 0, MAKELONG(pt.x, pt.y));
|
||||
SendMessage(hpanel, WM_LBUTTONUP, 0, MAKELONG(pt.x, pt.y));
|
||||
|
||||
// now create the popup menu using shell namespace and IContextMenu
|
||||
Pane* pane = GetFocus()==_left_hwnd? _left: _right;
|
||||
int idx = ListBox_GetCurSel(*pane);
|
||||
Entry* entry = (Entry*) ListBox_GetItemData(*pane, idx);
|
||||
|
||||
ShellPath shell_path = entry->create_absolute_pidl();
|
||||
LPCITEMIDLIST pidl = shell_path;
|
||||
|
||||
CHECKERROR(ShellFolderContextMenu(Desktop(), _hwnd, 1, &pidl, pos.x, pos.y));
|
||||
break;}
|
||||
|
||||
default: def:
|
||||
return super::WndProc(nmsg, wparam, lparam);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue