Jump to content

How to identify a system tray app icon & right click on it ?


Recommended Posts

Hello all,

I'm looking to deploy a menu from an app icon (right click) in the Windows system Tray, then click on a specific sub-menu line (evently use a "Send()" function to "browse" it, should be enougth for me)

My problem is: I can identify & activate the tray zone (Call CLASS = "Shell_TrayWnd"), but once done, I don't know how to parse or directly identify the sub-tray control or the app icon I'd like to right-click on.

FYI: the application is "f.lux", and I'd like to parse it's menus, & try to "Enable/Disable" the second monitor.

Here my code:

#include <AutoItConstants.au3>

$CallTray           = "[CLASS:Shell_TrayWnd]"       ; Main tray class
$CallTrayControl    = "[CLASS:ToolbarWindows32]"    ; So far, this "should be" the "sub" tray/control zone to call, containing the icons, next to the clock zone

$hWnd       = WinActivate($CallTray)
$aPoshHwn   = WinGetPos($hWnd)
MouseClick($MOUSE_CLICK_RIGHT, $aPoshHwn[0], $aPoshHwn[1])      ; "Problem is there" => the right click occurs on the "upper left" of the main tray, and not in the "sub" tray control zone...

On another hand, I'm not sure my approach is the correct one...

I may know the expected tray zone (=> $CallTrayControl ?) but don't know either how to activate it, nor, parse icons whitin it to click on one...

Possibly, is there any other way to directly access to the app icon (via its "flux.exe" executable) ? ... like, get its handle/PID => I know how to perform this (get exe handle/PID), but still don't know how to acces to the tray icon (or its coordinates) of this app.

Thx in avance for your help...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...