Juvigy Posted October 19, 2009 Share Posted October 19, 2009 (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 Edited October 19, 2009 by Juvigy Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 20, 2009 Share Posted October 20, 2009 You can probably Send("o") to it, or some other hot key. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Juvigy Posted October 20, 2009 Author Share Posted October 20, 2009 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? Link to comment Share on other sites More sharing options...
Authenticity Posted October 20, 2009 Share Posted October 20, 2009 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}") Link to comment Share on other sites More sharing options...
Juvigy Posted October 20, 2009 Author Share Posted October 20, 2009 10x , but i want to use something different than "send" / "controlsend". Is there another way? Link to comment Share on other sites More sharing options...
RagsRevenge Posted October 20, 2009 Share Posted October 20, 2009 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 Link to comment Share on other sites More sharing options...
Juvigy Posted October 20, 2009 Author Share Posted October 20, 2009 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. Link to comment Share on other sites More sharing options...
Authenticity Posted October 20, 2009 Share Posted October 20, 2009 (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 October 20, 2009 by Authenticity Link to comment Share on other sites More sharing options...
Juvigy Posted October 20, 2009 Author Share Posted October 20, 2009 10x _GUICtrlMenu_GetItemRect() doesnt look good to me. I will try the winhooks approach. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now