Gregor Brunmar : comctl32: Added context menu to treeview.
Alexandre Julliard
julliard at winehq.org
Fri Dec 7 13:19:12 CST 2007
Module: wine
Branch: master
Commit: f18b428ccfd17903ccbcc7e5d96abd79bb65c901
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f18b428ccfd17903ccbcc7e5d96abd79bb65c901
Author: Gregor Brunmar <gregor.brunmar at home.se>
Date: Sun Dec 2 12:28:09 2007 +0100
comctl32: Added context menu to treeview.
---
dlls/comctl32/treeview.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index aa12c4f..e77051c 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -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;
}
More information about the wine-cvs
mailing list