Sign in to follow this  
Followers 0
Juvigy

How to click a button from a taskbar tray icon ?

9 posts in this topic

#1 ·  Posted (edited)

I have outlook 2007 icon in the tray.

I manage to right click on it using:

_GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right")

Which opens the menu: Please see attachment.

Does anyone now how to click one of the buttons there ? Lets say "Open Outlook" ?

The autoit window tool doesnt show anything.

@Edit:

Readded attachment

post-38127-12559525163868_thumb.jpg

Edited by Juvigy

Share this post


Link to post
Share on other sites



Yes , that would work for this particular case but there are cases that the shortcut is not so easy to find and also some cases that the keyboard shortcut only selects the "button"(like in the attachment) or there is no shortcut at all. Is there a better more reliable way?

post-38127-12560217588015_thumb.jpg

Share this post


Link to post
Share on other sites

For the first one you can do something like:

_GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right")
Send("{UP 2}{ENTER}")

; For the second it'll probably be:
Send("{UP}{ENTER}")

Share this post


Link to post
Share on other sites

10x , but i want to use something different than "send" / "controlsend".

Is there another way?

Share this post


Link to post
Share on other sites

10x , but i want to use something different than "send" / "controlsend".

Is there another way?

I don't believe so.

Out of interest, how are you getting a value for $iSystray_ButtonNumber?

D

Share this post


Link to post
Share on other sites

First use _GUICtrlToolbar_ButtonCount to get all numbers and then use _GUICtrlToolbar_GetButtonText to match the text of the icon i need to the number.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I think that in this case Send/ControlSend functions are sufficiently reliable methods for such task. You can try this approach, put a global boolean variable to tell the callback function whether it should call your function with the handle of the new popup menu window and it's hmenu and then do your stuff. Another approach is to use _GUICtrlMenu_GetItemRect() and click it. Again, Send/ControlSend are sufficient.

Edited by Authenticity

Share this post


Link to post
Share on other sites

10x

_GUICtrlMenu_GetItemRect() doesnt look good to me. I will try the winhooks approach.

Share this post


Link to post
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
Sign in to follow this  
Followers 0