Tray icon controller
Using this module you can totally control Windows notification area. Your script can create any number of tray icons and receive notifications about user actions on them. Also, you can get and modify 3thd party tray icons information.
Tray | Tray icon controller |
Add | Add icon in the system tray. |
Count | Get the number of icons in the notificaiton area. |
Define | Get information about system tray icons. |
GetTooltip | Get tooltip of the tray icon. |
Modify | Modify icon properties. |
Move | Move the tray icons. |
Remove | Removes the tray icon. |
Refresh | Refresh tray icons. |
Example | |
About |
Tray_Add( hGui, Handler, Icon, Tooltip = "" )
Add icon in the system tray.
hGui | Handle of the parent window. |
Handler | Notification handler. |
Icon | Icon path or handle. Icons allocated by module will be automatically destroyed when Remove function returns. If you pass icon handle, Remove will not destroy it. If path is an icon resource, you can use “path:idx” notation to get the handle of the desired icon by its resource index (0 based). |
Tooltip | Tooltip text. |
Handler(Hwnd, Event)
Hwnd | Handle of the tray icon. |
Event | L (Left click), R(Right click), M (Middle click), P (Position - mouse move). Additionally, “u” or “d” can follow event name meaning “up” and “doubleclick”. For example, you will be notified on “Lu” when user releases the left mouse button. |
0 on failure, handle on success.
Tray_Define( Filter = "", pQ = "", ByRef o1 = "~`a ", ByRef o2 = "", ByRef o3 = "", ByRef o4 = "" )
Get information about system tray icons.
Filter | Contains process name, ahk_pid, ahk_id or 1-based position for which to return information. If you specify position as Filter, you can use output variables to store information. |
pQ | Query parameter, by default “ihw”. |
o1 .. o4 | Refernce to output variables. |
h | Handle. |
i | PosItion (1 based). |
w | Parent Window handle. |
p | Process Pid. |
n | Process Name. |
m | Message id. |
o | IcOn handle. |
String containing icon information per line.
Add icon in the system tray.
Tray_Add( hGui, Handler, Icon, Tooltip = "" )
Get the number of icons in the notificaiton area.
Tray_Count()
Get information about system tray icons.
Tray_Define( Filter = "", pQ = "", ByRef o1 = "~`a ", ByRef o2 = "", ByRef o3 = "", ByRef o4 = "" )
Get tooltip of the tray icon.
Tray_GetTooltip( Position )
Modify icon properties.
Tray_Modify( hGui, hTray, Icon, Tooltip = "~`a " )
Move the tray icons.
Tray_Move( Pos, NewPos = "" )
Removes the tray icon.
Tray_Remove( hGui, hTray = "" )
Refresh tray icons.
Tray_Refresh()