AllSystemGo Posted July 13, 2010 Share Posted July 13, 2010 Hello everyone, I have a software that I would like to automate the setting process. I have posted an image of what I'm trying to get of the software: http://img689.imageshack.us/img689/4439/dictionnaire.png What I'm trying to do is make autoit select the key on the top right then go to "Démarrage" then select the "Désactivé" option. I would like to be able to get there without the mousemove. If I try to get the window information I don't get anything when I hover over the key button on top! Is there another way to achieve what I'm trying to do?? PS: There is always the second option which is to go from the tray icon at the bottom! Thank you for the help! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 13, 2010 Moderators Share Posted July 13, 2010 AllSystemGo, There is always the second option which is to go from the tray icon at the bottomI can help with that bit! This script right-clicks on a tray icon: expandcollapse popup#Include <GuiToolBar.au3> Global $hSysTray_Handle, $iSystray_ButtonNumber Global $sToolTipTitle = "" ; <<<<<<<<<<<<<<<< Enter some tooltip text for the icon you want here $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Icon not found in system tray") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") EndIf Exit ;............ Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) <> 0 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc Using Send Up/Down/Left/Right/Enter with a short Sleep in between has always worked for me to navigate the menus once opened. I hope this helps. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AllSystemGo Posted July 13, 2010 Author Share Posted July 13, 2010 Thank you very much for your help. Your code works great but for some reason this stupid application won't let me navigate using the up and down command. Do you have any other way to select the menu once clicked?? Thank you Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 13, 2010 Moderators Share Posted July 13, 2010 AllSystemGo,Sorry to hear about that - I have never come across a tray menu that would not react to sending the cursor keys. I presume you can navigate the traymenu manually using the cursor keys?Are there "accelerator" keys (underlined caps) available on the menu? Although that is not often the case.And finally, please post the code you are using - we might see something there. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AllSystemGo Posted July 14, 2010 Author Share Posted July 14, 2010 Ok here goes... I'm telling you, the software I'm trying to setup automaticaly is so badly coded it's amazing. Anyways here is my code: expandcollapse popup#Include <GuiToolBar.au3> Global $hSysTray_Handle, $iSystray_ButtonNumber, $iIndex Global $sToolTipTitle = "38 Dictionnaires et Recueils de Correspondance" ; <<<<<<<<<<<<<<<< Enter some tooltip text for the icon you want here $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Icon not found in system tray") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") Sleep(1000) Send("{DOWN}") EndIf Exit ;............ Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) <> 0 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc Right now even if I manually right click the tray icon, I cannot move through the menu with my arrow keys!! Is there a way to get the collection of menu when I right click on that specific icon?? Thank you again! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 14, 2010 Moderators Share Posted July 14, 2010 AllSystemGo,Sounds like a fun app! even if I manually right click the tray icon, I cannot move through the menu with my arrow keysSo how do you navigate through the menu? With the mouse? Or does it just sit there and serve no useful purpose?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AllSystemGo Posted July 14, 2010 Author Share Posted July 14, 2010 Yeah basically the mouse is the only option available... But If I use the upper right button in the app itself I can use the up and down key!!! Basically the menu in the tray icon is the same as the one in the app itself on the top right icon! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 14, 2010 Moderators Share Posted July 14, 2010 (edited) AllSystemGo, the mouse is the only optionOK, let us try and work with this. If we use _GUICtrlToolbar_ClickButton with the $fMove parameter set to True, we actually move the mouse cursor to the icon position. We can then get the position of the mouse and use MouseClick or MouseMove with relative coordinates to move the mouse to the position(s) in the menu we need to click and.....it should work. So amend the top part of the script to read: Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right", True) $aMousePos = MouseGetPos() Sleep(250) MouseClick("left", $aMousePos[0] +- a_suitable_distance, $aMousePos[1] +- a_suitable_distance) ; repeat above Sleep and MouseMove/Click lines until we get to where we want to be!!!! This works for my "normal" tray menus when I test it - give it a whirl with your "wacky" one! M23 Edit: Typnig! Edited July 15, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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