Jump to content
Sign in to follow this  

MDI Form, ControlFocus Works, ControlSend Does Not

Recommended Posts

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, "", "")
$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")
$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]
 Return $h
Edited by t123456

Share this post

Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...