jonny1234 Posted July 26, 2006 Share Posted July 26, 2006 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 Link to comment Share on other sites More sharing options...
GaryFrost Posted July 26, 2006 Share Posted July 26, 2006 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. Link to comment Share on other sites More sharing options...
jonny1234 Posted July 26, 2006 Author Share Posted July 26, 2006 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 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