DssTrainer Posted March 3, 2009 Share Posted March 3, 2009 I'm trying to use autoit to generate a list of all editboxes on a windows form. like a simple vbasic form with 5 edit boxes. I'd like to scrape the form for all "children" and make a list of the controls. I was trying to use _WinAPI_GetWindow and if I use the $GW_CHILD option, I can get the handle of the first editbox control on that page. But How do I get the rest? Link to comment Share on other sites More sharing options...
Zedna Posted March 3, 2009 Share Posted March 3, 2009 (edited) Look at _WinAPI_EnumWindows, _WinAPI_EnumWindowsChild - I think it will help you to start.Also search forum I think this was discussed here already.Here are some links for youhttp://www.autoitscript.com/forum/index.ph...st&p=595834Func _GetClassName($hWnd) Local $ret = DllCall("User32.dll", "int", "GetClassName", "hwnd", $hWnd, "str","", "int", 4096) Return $ret[2] EndFunc Edited March 3, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
DssTrainer Posted March 3, 2009 Author Share Posted March 3, 2009 Here are some links for youhttp://www.autoitscript.com/forum/index.ph...st&p=595834That link returns an errorI did find this: http://www.autoitscript.com/forum/index.ph...nTitleMatchMode which seems to be a good start of what I'm after.Thx Link to comment Share on other sites More sharing options...
Zedna Posted March 3, 2009 Share Posted March 3, 2009 That link returns an errorCode from corrupted/deleted post ; get rid of $ctrl & $n from $ctrlIDs and you could StringSplit() IDs into an array. Send("#r") WinWait("Run") $ctrlIDs = "" $buffer = @LF & WinGetClassList("Run") While StringLen($buffer) > 1 $ctrl = StringTrimLeft(StringLeft($buffer,StringInStr($buffer,@LF,0,2)-1),1) $n = 1 While StringInStr($buffer,@LF & $ctrl & @LF) $hwnd = ControlGetHandle("Run","",$ctrl & $n) $ID = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hwnd) $ctrlIDs &= $ctrl & $n & "=" & $ID[0] & "," $buffer = StringReplace($buffer,@LF & $ctrl & @LF,@LF,1) $n+=1 WEnd WEnd $ctrlIDs = StringTrimRight($ctrlIDs,1) MsgBox(4096,"",$ctrlIDs) Resources UDF ResourcesEx UDF AutoIt Forum Search 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