summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorVlad Mironov <mironych@googlemail.com>2015-01-04 19:05:55 +0000
committerVlad Mironov <mironych@googlemail.com>2015-01-04 19:05:55 +0000
commit0b53ac8d4073db3a8325e5b59fa26e036ef2366f (patch)
tree52ff778049070d65786806391faea625c71c8881 /plugins/Clist_modern
parentdcb7dd2258da67892375b026d72eeefe9b757df2 (diff)
clist_modern: tray menu fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11771 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index fdc80ad56d..268873b2ca 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -242,6 +242,42 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
pcli->bTrayMenuOnScreen = FALSE;
break;
+ case TIM_CALLBACK:
+ if ((GetAsyncKeyState(VK_CONTROL) & 0x8000) && msg->lParam == WM_LBUTTONDOWN && !db_get_b(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT)) {
+ POINT pt;
+ HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
+ g_mutex_bOnTrayRightClick = 1;
+ IS_WM_MOUSE_DOWN_IN_TRAY = 1;
+ SetForegroundWindow(msg->hwnd);
+ SetFocus(msg->hwnd);
+ GetCursorPos(&pt);
+ pcli->bTrayMenuOnScreen = TRUE;
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
+ PostMessage(msg->hwnd, WM_NULL, 0, 0);
+ g_mutex_bOnTrayRightClick = 0;
+ IS_WM_MOUSE_DOWN_IN_TRAY = 0;
+ }
+ else if (msg->lParam == WM_MBUTTONDOWN || msg->lParam == WM_LBUTTONDOWN || msg->lParam == WM_RBUTTONDOWN) {
+ IS_WM_MOUSE_DOWN_IN_TRAY = 1;
+ }
+ else if (msg->lParam == WM_RBUTTONUP) {
+ HMENU hMenu = (HMENU)BuildTrayMenu(0, 0);
+ g_mutex_bOnTrayRightClick = 1;
+
+ SetForegroundWindow(msg->hwnd);
+ SetFocus(msg->hwnd);
+
+ POINT pt;
+ GetCursorPos(&pt);
+ pcli->bTrayMenuOnScreen = TRUE;
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
+ DestroyTrayMenu(hMenu);
+ PostMessage(msg->hwnd, WM_NULL, 0, 0);
+ }
+ else break;
+ *((LRESULT*)lParam) = 0;
+ return TRUE;
+
case WM_ACTIVATE:
SetCursor(LoadCursor(NULL, IDC_ARROW));
{