Sign in to follow this  
Followers 0
Rytz

Sending input to an inactive window (without making active)...

14 posts in this topic

Sorry if this has been asked before. I tried searching the forums / FAQ / documentation. I used AutoIt v2 a while back and it's great, so I'm sure it's even better now.

Is it possible to send input to an inactive window without making it active? The purpose is to script things on one window while being able to do something else on another window (without the risk of accidentally sending input to an unwanted window).

I'm sure there's a way to work around (to a degree) if there's not an exact function for this task. I was already thinking about trying to make the input window active and then going back to the original window when finished.

Any thoughts? Thanks in advance.

~ Rytz

Share this post


Link to post
Share on other sites



Control Send will be what you are looking for.

Share this post


Link to post
Share on other sites

Control Send will be what you are looking for.

Unfortunately I'm working with a window that doesn't have controls :whistle:.

Share this post


Link to post
Share on other sites

What does it have?

Share this post


Link to post
Share on other sites

What does it have?

I haven't really used any programs to find out the window properties yet but I'm trying to send keystrokes to a 3D application. The only "standard" properties that I see are the title bar and the mix / max / close buttons on the top right.

Share this post


Link to post
Share on other sites

What commands were you wanting to send? Any click commands in a 3d app will need coordinates.

Share this post


Link to post
Share on other sites

What commands were you wanting to send? Any click commands in a 3d app will need coordinates.

I'm just trying to send a single keystroke. I'm not really trying to interact directly with the 3D app itself. I just want to send standard input to the window.

Share this post


Link to post
Share on other sites

Anyone?

Share this post


Link to post
Share on other sites

It looks like you can send a command without specifying a destination control.

http://www.autoitscript.com/forum/index.ph...=send++inactive

I tried ControlSend the following ways and nothing worked:

ControlSend("Window Name Here", "", "", "{ENTER}")

ControlSend("Window Name Here", "", "Window Name Here", "{ENTER}")

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I should have added that the ControlSend function is returning true. So it's sending the requests out successfully but I'm not seeing anything in the actual app window. Any thoughts?

I also used the window info tool and there are no controls present on the window.

Edited by Rytz

Share this post


Link to post
Share on other sites

are the controls tab 'able' ?

Cause you could always {tab} to the control and fill it with the regular Send

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Thanks for all the replies / help :whistle:.

are the controls tab 'able' ?

Cause you could always {tab} to the control and fill it with the regular Send

There are no controls in the window at all. Therefore there is nowhere to tab to on the window. I'm wanting to do other things while running this script and not have to worry about being focused on the scripted window. Normal Send is working fine but that's not what I'm trying to accomplish.

I tried the code I posted above and it doesn't work in Notepad either if the Notepad window is inactive. I'm guessing something is blocking the input that's being sent to the app window. Any other ideas / thoughts?

Edited by Rytz

Share this post


Link to post
Share on other sites

Anyone?

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  
Followers 0