Jump to content

ControlSend sends to the wrong window


Recommended Posts

Hi ther!

I have got a big problem with ControlSend. I want to send inputs to multiple windows.. So I createt a handle to each of the windows. But when i run the script it sometimes sends to the right windows, and sometimes (crap.. most of the time) it sends inputs to the wrong window.

Example:

global const $handle1 = WinGetHandle("Window1")

global const $handle2 = WinGetHandle("Window2")

ControlSend($handle1, "", "", "sometext") ;There is no text in the window

ControlSend($handle2, "", "", "moretext") ;same here

The problem is, when i run the script, it sends both inputs to Window2. In my eyes this is impossible, because one handle can not refer to 2 windows at once.

:)

Edited by Term!nX
Link to comment
Share on other sites

It's a known behaviour of ControlSend() when used with "empty" control names.

See http://www.autoitscript.com/forum/index.ph...st&p=352662 .

Workarounds:

1) Specify the Control Name in the ControlSend() command

2) If no controls exist on the window to specify, then either activate the Window you want to send to first or

3) Use "Send()" instead.

In short, without specifying a Control name, you have to activate the window

Edited by ResNullius
Link to comment
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
 Share

  • Recently Browsing   0 members

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