Compare commits

..

No commits in common. "master" and "v11.55.0.0" have entirely different histories.

3 changed files with 6 additions and 9 deletions

4
main.c
View File

@ -513,7 +513,7 @@ HandleCopyDataMessage(const COPYDATASTRUCT *copy_data)
}
else if (copy_data->dwData == WM_OVPN_RESCAN)
{
OnNotifyTray(0, WM_OVPN_RESCAN);
OnNotifyTray(WM_OVPN_RESCAN);
}
else
{
@ -653,7 +653,7 @@ WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_NOTIFYICONTRAY:
OnNotifyTray(wParam, lParam); /* Manages message from tray */
OnNotifyTray(lParam); /* Manages message from tray */
break;
case WM_COPYDATA: /* custom messages with data from other processes */

9
tray.c
View File

@ -427,20 +427,17 @@ PositionTrayToolTip(LONG x, LONG y)
* Handle mouse clicks on tray icon
*/
void
OnNotifyTray(WPARAM wParam, LPARAM lParam)
OnNotifyTray(LPARAM lParam)
{
POINT pt;
/* Use LOWORD(lParam) as HIWORD() contains the icon id if uVersion >= 4 */
switch (LOWORD(lParam))
{
case WM_CONTEXTMENU:
case WM_RBUTTONUP:
RecreatePopupMenus();
/* wParam contains the upper left corner of the anchor point */
pt.x = (int)LOWORD(wParam);
pt.y = (int)HIWORD(wParam);
GetCursorPos(&pt);
SetForegroundWindow(o.hWnd);
TrackPopupMenu(hMenu, TPM_RIGHTALIGN, pt.x, pt.y, 0, o.hWnd, NULL);
PostMessage(o.hWnd, WM_NULL, 0, 0);

2
tray.h
View File

@ -49,7 +49,7 @@ void RecreatePopupMenus(void);
void CreatePopupMenus();
void OnNotifyTray(WPARAM, LPARAM);
void OnNotifyTray(LPARAM);
void OnDestroyTray(void);