How to intercept the tray menu?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

How to intercept the tray menu?

27 Apr 2019, 10:48

Right click on the tray icon to execute the command directly instead of displaying the menu. Excuse me, how to achieve(V2)?
User avatar
JoeWinograd
Posts: 2203
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: How to intercept the tray menu?

27 Apr 2019, 11:44

I like to give credit where credit is due, but I don't know who wrote this code. I do know that it's from this group...that I didn't write it...and that it works perfectly:

Code: Select all

Menu,Tray,NoStandard
OnMessage(0x404,"AHK_NOTIFYICON")
AHK_NOTIFYICON(wParam,lParam)
{
  If (lParam=0x201) ; WM_LBUTTONDOWN
  {
    ; left-click code here
    MsgBox left-click code here
  }
  If (lParam=0x204) ; WM_RBUTTONDOWN
  {
    ; right-click code here
    MsgBox right-click code here
  }
  Return
}
My thanks to the member who wrote the code...and apologies for not being to acknowledge who you are. Regards, Joe
arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: How to intercept the tray menu?

27 Apr 2019, 15:47

Thank you. This is exactly what I need. ;)
User avatar
JoeWinograd
Posts: 2203
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: How to intercept the tray menu?

27 Apr 2019, 16:26

You're welcome. Glad to hear that's what you need. Regards, Joe

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Xtra and 349 guests