From ce527de51f42c1047555d052ea4e0d9a7593b192 Mon Sep 17 00:00:00 2001
From: Pascal Lessard <pascal@macadamian.com>
Date: Tue, 29 Feb 2000 22:04:00 +0000
Subject: [PATCH] Implemented the behavior of sending WM_CONTEXTMENU when
 receiving a WM_RBUTTONUP.

---
 dlls/comctl32/header.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c
index 6f221e7294b..8a2b079570c 100644
--- a/dlls/comctl32/header.c
+++ b/dlls/comctl32/header.c
@@ -1382,7 +1382,22 @@ HEADER_Paint (HWND hwnd, WPARAM wParam)
 static LRESULT
 HEADER_RButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
 {
-    return HEADER_SendSimpleNotify (hwnd, NM_RCLICK);
+    BOOL bRet;
+    POINT pt;
+
+    pt.x = LOWORD(lParam);
+    pt.y = HIWORD(lParam);
+
+    /* Send a Notify message */
+    bRet = HEADER_SendSimpleNotify (hwnd, NM_RCLICK);
+
+    /* Change to screen coordinate for WM_CONTEXTMENU */
+    ClientToScreen(hwnd, &pt);
+
+    /* Send a WM_CONTEXTMENU message in response to the RBUTTONUP */
+    SendMessageA( hwnd, WM_CONTEXTMENU, (WPARAM) hwnd, MAKELPARAM(pt.x, pt.y));
+    
+    return bRet;
 }
 
 
-- 
GitLab