Page 1 of 1

Multiple controls of same class type

Posted: Thu Mar 29, 2007 7:25 pm
by James Hirst
Hi,

I'm attempting to automate a UI with multiple comboboxes - the problem is that using FormFindChildClassName (which I'm stuck with on the Windows Display Porperties dialog) will just find the first one - using FormFindChildClassName(hWnd, 'ComboBox #1') and FormFindChildClassName(hWnd, 'ComboBox #2') makes no difference!

To put it into context I'm automating the Display and Color Quality comboboxes on the Settings property page of the Desktop Properties dialog.

Any assistance appreciated!

Thanks,
James

Posted: Thu Mar 29, 2007 8:30 pm
by webops
You should use the instance number as the third parameter and not in the class name:

Code: Select all

# Find the second combo box
FormFindChildClassName(hWnd, 'ComboBox', 2)
To put it into context I'm automating the Display and Color Quality comboboxes on the Settings property page of the Desktop Properties dialog.
I think it would be better to use the FrmFindChildControlId function, the ControlId is a unique identifier in this dialog.

Jenö Herget
Ranorex Team