comctl32: Added context menu to treeview.

This commit is contained in:
Gregor Brunmar 2007-12-02 12:28:09 +01:00 committed by Alexandre Julliard
parent 490e0029ea
commit f18b428ccf
1 changed files with 15 additions and 0 deletions

View File

@ -4160,6 +4160,21 @@ TREEVIEW_RButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam)
static LRESULT
TREEVIEW_RButtonUp(const TREEVIEW_INFO *infoPtr, const POINT *pPt)
{
TVHITTESTINFO ht;
ht.pt = *pPt;
TREEVIEW_HitTest(infoPtr, &ht);
if (ht.hItem)
{
/* Change to screen coordinate for WM_CONTEXTMENU */
ClientToScreen(infoPtr->hwnd, &ht.pt);
/* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */
SendMessageW(infoPtr->hwnd, WM_CONTEXTMENU,
(WPARAM)infoPtr->hwnd, MAKELPARAM(ht.pt.x, ht.pt.y));
}
return 0;
}