selecting the correct program on the system tray

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
johnsis
Newbie
Posts: 10
Joined: Fri Nov 30, 2007 6:59 pm

selecting the correct program on the system tray

Post by johnsis » Tue Mar 10, 2009 1:15 pm

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?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Mar 14, 2009 1:45 pm

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.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon Mar 16, 2009 1:35 am

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.

johnsis
Newbie
Posts: 10
Joined: Fri Nov 30, 2007 6:59 pm

Post by johnsis » Mon Sep 21, 2009 12:24 am

Can you tell me how to capture a systray icon?

fightcancer
Macro Veteran
Posts: 249
Joined: Fri Apr 15, 2005 8:32 am

Post by fightcancer » Sat Sep 26, 2009 7:54 pm


Jerryth31
Newbie
Posts: 19
Joined: Wed Jun 18, 2008 6:03 pm

Re: selecting the correct program on the system tray

Post by Jerryth31 » Tue Feb 03, 2015 5:53 pm

Is image recognition still the best way to click a tray 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

User avatar
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

Post by Marcus Tettmar » Wed Feb 04, 2015 8:42 am

Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts