Jump to content
Sign in to follow this  
Term!nX

ControlSend sends to the wrong window

Recommended Posts

Term!nX

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

Share this post


Link to post
Share on other sites
ResNullius

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

Share this post


Link to post
Share on other sites
Shevilie

Try the newest beta and see if that helps


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

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  

×