selecting the correct program on the system tray
Moderators: Dorian (MJT support), JRL
selecting the correct program on the system tray
I found the code that will allow me to jump to the system tray and using Send>P a couple of times will jump to the different program and then I can send Enter to open the program. The issue is depending on where the icon ends up in the list on the systray will depend on how many Send>P I need to run. Is there anyway to get the program name that I am on before I hit enter?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Unfortunately I don't know of any way to do this.
Probably the easiest way to activate system tray icons is to use image recognition. Simply capture the tray icon and then use FindImagePos to find it, move the mouse to it's position and click on it.
Remember: System tray icons are just icons. While it is common to imagine apps as being "minimized to the tray" this is not actually what happens. Some "tray apps" hide themselves when you "minimize to the tray". In these situations it is *sometimes* possible to simply SetFocus the hidden window title to make it visible. But sometimes an app uses a small process which does nothing but display an icon in the tray and monitor actions/menu entries and then start the real process which then terminates when you close or "minimize it to the tray" again. So unlike apps minimized to the task bar you cannot assume that the process/window of the interface even exists with a system tray app.
Probably the easiest way to activate system tray icons is to use image recognition. Simply capture the tray icon and then use FindImagePos to find it, move the mouse to it's position and click on it.
Remember: System tray icons are just icons. While it is common to imagine apps as being "minimized to the tray" this is not actually what happens. Some "tray apps" hide themselves when you "minimize to the tray". In these situations it is *sometimes* possible to simply SetFocus the hidden window title to make it visible. But sometimes an app uses a small process which does nothing but display an icon in the tray and monitor actions/menu entries and then start the real process which then terminates when you close or "minimize it to the tray" again. So unlike apps minimized to the task bar you cannot assume that the process/window of the interface even exists with a system tray app.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
Also remember that system tray icons auto hide so if you are using image recognition you may need to hit the "<" first.
I've been lucky with Marcus' suggested direct ways of opening sys tray icons. Maximizing the window has worked a couple of times, and the one that didn't work that way started a separate monitoring application that I found in that program's install directory.
I've been lucky with Marcus' suggested direct ways of opening sys tray icons. Maximizing the window has worked a couple of times, and the one that didn't work that way started a separate monitoring application that I found in that program's install directory.
-
- Macro Veteran
- Posts: 252
- Joined: Fri Apr 15, 2005 8:32 am
Re: selecting the correct program on the system tray
Is image recognition still the best way to click a tray icon?
I tried this but it doesn't click the icon:
I tried this but it doesn't click the icon:
Code: Select all
FindObject>0,Shell_TrayWnd,,1,hWnd,X1,Y1,X2,Y2,result
Let>WIN_USEHANDLE=1
UIClick>hWnd,{"OMAX Intelli-VISOR"}
Let>WIN_USEHANDLE=0
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: selecting the correct program on the system tray
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?