How to intercept the tray menu?

Get help with using AutoHotkey and its commands and hotkeys
arcticir
Posts: 576
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: 1249
Joined: 10 Feb 2014, 20:00

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: 576
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: 1249
Joined: 10 Feb 2014, 20:00

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”

Who is online

Users browsing this forum: Ahk_fan, CheshireCat, DannyhelMont, flyingDman, Getfree, Google [Bot], MannyKSoSo, Pilu and 160 guests