Jump to content

Recommended Posts

Posted

Hi,

I am trying to get the handle of a dropdown list. I know the window title and the control ID, so I'm using:

$window_title = $cmdline[1]

$dropdown_list_id = $cmdline[2]

$dropdown_list_handle = ControlGetHandle($window_title, "", $dropdown_list_id)

msgbox (0, "", $dropdown_list_handle)

But $dropdown_list_handle displays blank.

But when I use an explicit value for $dropdown_list_id, instead of getting it from the command line, it works. For example:

$window_title = $cmdline[1]

$dropdown_list_id = 1044

$dropdown_list_handle = ControlGetHandle($window_title, "", $dropdown_list_id)

msgbox (0, "", $dropdown_list_handle)

So it seems that the value of $dropdown_list_id is not being read properly from the command line. My command line is just:

autoit3 dl_handle_get.au3 "My Window" 1044

Please can you tell me why this might be.

Thanks for your help.

Regards,

Jonny

Posted

Have you tried to convert the command line string to a number? i.e.

$window_title = $cmdline[1]
$dropdown_list_id = Number($cmdline[2])
$dropdown_list_handle = ControlGetHandle($window_title, "", $dropdown_list_id)
msgbox (0, "", $dropdown_list_handle)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted

Have you tried to convert the command line string to a number? i.e.

$window_title = $cmdline[1]
$dropdown_list_id = Number($cmdline[2])
$dropdown_list_handle = ControlGetHandle($window_title, "", $dropdown_list_id)
msgbox (0, "", $dropdown_list_handle)
Thanks, it works.

Regards,

Jonny

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...