syno Posted October 22, 2009 Share Posted October 22, 2009 Hi guys Just a quick one....I hope. A friend advises me you cannot use the send command, for example: Send("{tab}") To a drop down box...Is this correct? If so how do I do this to a drop down box.. Thank you Link to comment Share on other sites More sharing options...
Yashied Posted October 22, 2009 Share Posted October 22, 2009 See _GUICtrlComboBox_ShowDropDown() or ControlCommand() with "ShowDropDown" command. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
syno Posted October 25, 2009 Author Share Posted October 25, 2009 (edited) Hi there Thanks for your help..I have tried a few things but do not really know whether I am using these commands correctly. I have tried both: Run('C:\AppTool.exe') Local $iSysTrayApp = ControlGetHandle('[Class:ThunderRT6FormDC]', '', '[Class:DTPicker20WndClass;Instance:1]') _GUICtrlComboBox_ShowDropDown($iSysTrayApp, True) and Run('C:\AppTool.exe') ControlCommand('[Class:ThunderRT6FormDC]', '', 'DTPicker20WndClass', 'ShowDropDown', '') If @error Then MsgBox(16, 'Error', 'Abatec drop down list not found') Exit EndIf As I say I do not really know wheather the syntax is right....as I am only a noob but I can't see why these two code snippets would not work. I am trying to show a drop down box in an application when launching.. Thanks Edited October 25, 2009 by syno Link to comment Share on other sites More sharing options...
syno Posted October 26, 2009 Author Share Posted October 26, 2009 (edited) Hi guys I now have the following code working and I will need to use ControlFocus as opposed to ControlCommand. The code below works: WinWait("AppTool", "") If Not WinActive("AppTool", "") Then WinActivate("AppTool", "") WinWaitActive("AppTool", "") ControlFocus("[CLASS:ThunderRT6FormDC]", "", "[CLASS:DTPicker20WndClass;INSTANCE:1]") If @error Then MsgBox(16, 'Error', 'AppTool drop down list not found') Exit EndIf However when I add it to a piece of code I am using that double clicks the AppTool to open from the SysTray it does not work, i.e expandcollapse popup#Include <GuiToolBar.au3> #include "SysTray_UDF.au3" Global $hSysTray_Handle Global $iSystray_ButtonNumber Global $sToolTipTitle = "daily" ; <<<<<<<<<<<<<<<< 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, "left", False, 2) 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) = 1 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc WinWait("AppTool", "") If Not WinActive("AppTool", "") Then WinActivate("AppTool", "") WinWaitActive("AppTool", "") ControlFocus("[CLASS:ThunderRT6FormDC]", "", "[CLASS:DTPicker20WndClass;INSTANCE:1]") If @error Then MsgBox(16, 'Error', 'AppTool focus not found') Exit EndIf The code above also uses a UDF so I have attached that also.. Thanks for your help...SysTray_UDF.au3 Edited October 26, 2009 by syno 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