T r a y
Tray icons monitor & controller
Download Documentation
Notes
- How to automate tray icon menu selection reliably.
- See Appbar for one real life usage example.
[module] Tray 2.1
Started by
majkinetor
, Nov 28 2007 03:07 PM
30 replies to this topic
Great Thank you very much.
It's good to know that we are not limited with the number of tray icons anymore.
It's good to know that we are not limited with the number of tray icons anymore.
#2
-
Posted 28 November 2007 - 04:16 PM
I will find this useful. Thanks. Looks pretty easy to use.
#3
-
Posted 28 November 2007 - 10:22 PM
“yields falsehood when preceded by its quotation” yields falsehood when preceded by its quotation.
this piece of soft is very interesting!
@majkinetor:
is there a way to attach different menus to the tray icons?
with your test script every created icon shares the same menu.
i tried different things but wasn't able to do it the right way.
regards...
Junyx
@majkinetor:
is there a way to attach different menus to the tray icons?
with your test script every created icon shares the same menu.
i tried different things but wasn't able to do it the right way.
regards...
Junyx
#4
-
Posted 29 November 2007 - 09:51 PM
Yes, something like:
hIcon1 := Tray_Add(...) hIcon2 := Tray_Add(...) OnTrayIcon(wparam, lparam) { local msg static LBUTTONDOWN=0x201, LBUTTONUP=0x202, LBUTTONDBLCLK=203, RBUTTONDOWN=0x204, .... msg := lparam & 0xFFFF if (msg != RBUTTONUP) return if (wparam = hIcon1) ShowMenu(menu1) if (wparam = hIcon2) ShowMenu(menu2) }
#5
-
Posted 29 November 2007 - 10:50 PM
thanks, man!
will try it on weekend.
i thought my "solution" looked similar but didn't work out as expected...
will try it on weekend.
i thought my "solution" looked similar but didn't work out as expected...
#6
-
Posted 30 November 2007 - 01:45 PM
interesting.
glanced at code but did not see, is there a reason is placing only lo-res version of icons ?
glanced at code but did not see, is there a reason is placing only lo-res version of icons ?
#7
-
Posted 03 December 2007 - 12:31 PM
Joyce Jamce
LOL... well, there is a reason.
I am totaly bored by that topic (icons in the menus) and didn't find the way back then (while developing MMenu) to 1) load shell icons in any other size then 32 or 16, 2) make them hi res.
I beleive lexikos answered both of those questions, so perhaps we can summon him here for help instead of taking it hard way and browsing his Menu function.
I am totaly bored by that topic (icons in the menus) and didn't find the way back then (while developing MMenu) to 1) load shell icons in any other size then 32 or 16, 2) make them hi res.
I beleive lexikos answered both of those questions, so perhaps we can summon him here for help instead of taking it hard way and browsing his Menu function.
#8
-
Posted 03 December 2007 - 01:18 PM
i tried the code (merged it with your _Test.ahk) - but i won't work.hIcon1 := Tray_Add(...) hIcon2 := Tray_Add(...) OnTrayIcon(wparam, lparam) { local msg static LBUTTONDOWN=0x201, LBUTTONUP=0x202, LBUTTONDBLCLK=203, RBUTTONDOWN=0x204, .... msg := lparam & 0xFFFF if (msg != RBUTTONUP) return if (wparam = hIcon1) ShowMenu(menu1) if (wparam = hIcon2) ShowMenu(menu2) }
menu2 will be displayed, but not only for tray icon no. 2.
instead both tray menus will be set to menu2.
did you try your code yourself?
#9
-
Posted 03 December 2007 - 06:02 PM
you didn't do something correctly.
This example works:
This example works:
#NoTrayIcon #SingleInstance force Gui, +LastFound hwnd := WinExist() menus = (LTrim [TrayMenu1] 11 12 [TrayMenu2] 21 22 23 ) h1 := Tray_Add( hwnd, "OnTrayIcon", "res\new.ico") h2 := Tray_Add( hwnd, "OnTrayIcon", "res\new.ico") return TrayMenu1: msgbox Hi from menu1 return TrayMenu2: msgbox Hi from menu2 return OnTrayIcon(wparam, lparam) { local msg static LBUTTONDOWN=0x201, LBUTTONUP=0x202, LBUTTONDBLCLK=203, RBUTTONDOWN=0x204, RBUTTONUP=0x205, RBUTTONDBLCLK=0x206, MBUTTONDOWN=0x207, MBUTTONUP=0x208, MBUTTONDBLCLK=0x209 msg := lparam & 0xFFFF if (msg != RBUTTONUP) return if (wparam=h1) ShowMenu(menus, "TrayMenu1") else ShowMenu(menus, "TrayMenu2") } #include Tray.ahk #include res\ShowMenu.ahk
#10
-
Posted 03 December 2007 - 11:12 PM
okay, thanks. your last code worked for me.
Junyx
Junyx
#11
-
Posted 05 December 2007 - 07:29 PM
#12
-
Posted 18 January 2008 - 02:30 PM
* v2.1 *
+ Tray_Click - you can now send click to any tray icon (even hidden ones) and generally totally automate tray area
+ Tray_Disable -allows you to totally disable notification area.
+ Tray_Focus - allows you to focus tray icon or tray area. You can then use keyboard to launch menus or move around.
+ Tray_Rect - get coordiantes of the icon, screen or relative.
+ Sample updated - clicking on icon will now send click to icon, use shift left click to dbl left click the icon.
+ Tray_Click - you can now send click to any tray icon (even hidden ones) and generally totally automate tray area
+ Tray_Disable -allows you to totally disable notification area.
+ Tray_Focus - allows you to focus tray icon or tray area. You can then use keyboard to launch menus or move around.
+ Tray_Rect - get coordiantes of the icon, screen or relative.
+ Sample updated - clicking on icon will now send click to icon, use shift left click to dbl left click the icon.
#14
-
Posted 10 September 2009 - 06:29 PM
This is small example of how to select particular item from the menu of 3td party tray icon.
Program CCC.exe holds ATI video driver tray menu. I am selecting second item of the first submenu with the following code:
This code is very reliable because it doesn't depend on Taskbar settings (if its hidden, on non-default position, disabled, etc...) and notification area settings (for instance, if icon is moved to the hidden icons)
Program CCC.exe holds ATI video driver tray menu. I am selecting second item of the first submenu with the following code:
BlockInput, on pos := Tray_Define("CCC.exe", "i") Tray_Click(pos, "R") WinWait, ahk_class #32768 ; WinHide, ahk_class #32768 ;this and next line are to hide the menu. ; WinKill, ahk_class SysShadow ControlSend,,{Down}{Down}{Right}{Down}{ENTER},ahk_class #32768 BlockInput, off ExitApp
This code is very reliable because it doesn't depend on Taskbar settings (if its hidden, on non-default position, disabled, etc...) and notification area settings (for instance, if icon is moved to the hidden icons)
#15
-
Posted 10 September 2009 - 07:11 PM