cdebel2005 Posted January 18, 2016 Share Posted January 18, 2016 Let's say i have an application xyz made by a 3rd party, and one of its form contain a ComboBox, is it possible to read the current value (text) of the combobox? Yet, all i've found is informations to read values of combobox in form i've created with AutoIt, but that's not my goal. Thanks for your help! Link to comment Share on other sites More sharing options...
Xandy Posted January 18, 2016 Share Posted January 18, 2016 (edited) Does this work? #include <GuiComboBox.au3> local $iCombo_index= -1 local $hControl= controlgethandle($handle_3rdparty_window, "", $i_3rdparty_combobox_control_id) local $sData= "None" $iCombo_index= _GUICtrlComboBox_GetCurSel($hControl); -1 on null unchoosen dropdown value if $iCombo_index > -1 then _GUICtrlComboBox_GetLBText($hControl, $iCombo_index, $sData) endif consolewrite($sData) Edit tried to touch it up by hand here and there were a few errors that I hopefully cleaned up. You''ll have to get the handle to the 3rd party window and the control ID of the combobox query. Edited January 18, 2016 by Xandy cdebel2005 1 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
cdebel2005 Posted January 20, 2016 Author Share Posted January 20, 2016 It work, but is there any way to get the informations of what's below the cursor or at a specific X,Y coord on the screen? I've got the $handle_3rdparty_window from the Dialog Title ("Preferences"), and got the $i_3rdparty_comobox_control_id from "AutoIt Windows Info" but i would prefer to do it programmatically. Thanks Xandy 1 Link to comment Share on other sites More sharing options...
Xandy Posted January 20, 2016 Share Posted January 20, 2016 (edited) Good job! Can you modify this or you need me make it more readable? func combo_items_write($client_record_id) local $hcontrol= 0, $combo_index= 0, $combo_item_string= "", $path= @scriptdir&"\Combo_Data\" $window= window_find() if $window<> "" then $hcontrol= controlgethandle($window, "", $field_info[$client_record_id][$fi_cid]) if @error<> 0 then consolewrite("error obtaining control handle, in write_combo_items()"&@crlf&$wintitle&@crlf&$wintitle_occurance&@crlf&$field_info[$client_record_id][$fi_cid], 1) return endif dircreate($path); There will be a directory $combo_items= _GUICtrlComboBox_GetCount($hcontrol) if $combo_items> 0 then local $combo_items_a[$combo_items] for $combo_index= 0 to $combo_items-1 _GUICtrlComboBox_GetLBText($hcontrol, $combo_index, $combo_items_a[$combo_index]) next $file= fileopen($path&$field_info[$client_record_id][$fi_label]&".txt", 2) for $combo_index= 0 to $combo_items-1 filewriteline($file, $combo_items_a[$combo_index]) next fileclose($file) endif;combo_items> 0 endif;win_a[0][0]> 0 EndFunc;write_combo_items() Edited January 20, 2016 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
cdebel2005 Posted January 20, 2016 Author Share Posted January 20, 2016 I don't see how this will help to get the ID at a specific screen coordinates. I've found what i neede here from _WinAPI_GetAncestor and _Mouse_Control_GetInfo. Thanks for the help you have provided Xandy 1 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