Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

MDI Form, ControlFocus Works, ControlSend Does Not

$
0
0
I'm using _EnumChildWindows.au3 to get a list of handles

This works, I can see the cursor move to the correct text box and back.

$hWin = get_handle($aEnumList, "JYACCmultitext", 2)
ControlFocus($hWin, "", "")
Sleep(1000)
$hWin = get_handle($aEnumList, "JYACCmultitext", 1)
ControlFocus($hWin, "", "")


This doesn't work, both "test1" and "test2" print in the first textbox which has focus, just as you'd expect Send would.

$hWin = get_handle($aEnumList, "JYACCmultitext", 2)
ControlSend($hWin, "", "", "test1")
Sleep(1000)
$hWin = get_handle($aEnumList, "JYACCmultitext", 1)
ControlSend($hWin, "", "", "test2")


If I try to set focus with ControlFocus and then do a ControlSend, it prints in the first text box also.

The two handles returned for each text box are different. For example 0x000C0A6A and 0x00060A72 so I'm lead to believe get_handle is working correctly, and the handles do work with ControlFocus.

$handle = get_handle($aList, $sControl, $iIteration)

Any ideas of why control send is not working?  ControlSend returns a 1 when I use these handles.

 
Func get_handle($aList, $sClass, $iIteration)
 Local $h
 For $i=1 to $aList[0][0]
  if $aList[$i][1] = $sClass And $aList[$i][3] = $iIteration Then
	$h = $aList[$i][0]
  EndIf
 Next
 Return $h
EndFunc


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>