Alexandre Julliard : explorer: Show the application system menu on taskbar right clicks.

Alexandre Julliard julliard at winehq.org
Wed Jun 8 11:07:35 CDT 2016


Module: wine
Branch: master
Commit: 552555cf8ca6e457b22c6f900fce290770c67eff
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=552555cf8ca6e457b22c6f900fce290770c67eff

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jun  8 15:35:38 2016 +0900

explorer: Show the application system menu on taskbar right clicks.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/explorer/systray.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c
index 1ed16ed..94ba74b 100644
--- a/programs/explorer/systray.c
+++ b/programs/explorer/systray.c
@@ -116,6 +116,8 @@ static HWND balloon_window;
 #define BALLOON_SHOW_MIN_TIMEOUT 10000
 #define BALLOON_SHOW_MAX_TIMEOUT 30000
 
+#define WM_POPUPSYSTEMMENU  0x0313
+
 static void do_show_systray(void);
 
 /* Retrieves icon record by owner window and ID */
@@ -689,6 +691,13 @@ static void click_taskbar_button( HWND button )
     SetForegroundWindow( hwnd );
 }
 
+static void show_taskbar_contextmenu( HWND button, LPARAM lparam )
+{
+    ULONG_PTR id = GetWindowLongPtrW( button, GWLP_ID );
+
+    if (id) SendNotifyMessageW( (HWND)id, WM_POPUPSYSTEMMENU, 0, lparam );
+}
+
 static void do_hide_systray(void)
 {
     SetWindowPos( tray_window, 0,
@@ -812,6 +821,10 @@ static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
         if (HIWORD(wparam) == BN_CLICKED) click_taskbar_button( (HWND)lparam );
         break;
 
+    case WM_CONTEXTMENU:
+        show_taskbar_contextmenu( (HWND)wparam, lparam );
+        break;
+
     case WM_MOUSEACTIVATE:
         return MA_NOACTIVATE;
 




More information about the wine-cvs mailing list