Jump to content
Sign in to follow this  
Davide

comboBox problems

Recommended Posts

Davide

Hi all.

I am trying to get a list of items from a comboBox. All the time I tried I eneded up having an empty list

$controlNN = "WindowsForms10.COMBOBOX.app.0.378734a1" ; the combo box with list of payment types

$hlist = ControlGetHandle( $appWinTitle, "", $controlNN )

$controlID = _GetDlgCtrlID($hlist)

$comboList = _GUICtrlComboGetList ($controlID)

Func _GetDlgCtrlID($hwnd)

; get controlID of a control

local $ID = DllCall('user32.dll', 'int', 'GetDlgCtrlID', 'hwnd', $hwnd)

if IsArray ($ID) Then Return $ID[0]

Return 0

EndFunc ; ==>GetDlgCtrlID

I got the $controlNN from AutoIt Window Info tool. It seems that autoit is unable to deal with this comboBox :P

Any suggestion ?

Share this post


Link to post
Share on other sites
PsaltyDS

Hi all.

I am trying to get a list of items from a comboBox. All the time I tried I eneded up having an empty list

$controlNN = "WindowsForms10.COMBOBOX.app.0.378734a1" ; the combo box with list of payment types

$hlist = ControlGetHandle( $appWinTitle, "", $controlNN )

$controlID = _GetDlgCtrlID($hlist)

$comboList = _GUICtrlComboGetList ($controlID)

Func _GetDlgCtrlID($hwnd)

; get controlID of a control

local $ID = DllCall('user32.dll', 'int', 'GetDlgCtrlID', 'hwnd', $hwnd)

if IsArray ($ID) Then Return $ID[0]

Return 0

EndFunc ; ==>GetDlgCtrlID

I got the $controlNN from AutoIt Window Info tool. It seems that autoit is unable to deal with this comboBox ;)

Any suggestion ?

All those gyrations to get the control ID are unnecessary. The _GUICtrlComboBox_GetList() function in the current Beta takes the control handle. That should work more reliably with less code.

:P


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

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  

×