Jump to content
Sign in to follow this  
senatorwolf

ControlSend not working in background

Recommended Posts

senatorwolf

while 1==1
    ControlSend("Untitled - Notepad", "", "", "l")
    sleep(100)
WEnd

I am trying to get ControlSend to send Notepad keystrokes while it is either minimized or not that active window, currently neither will work, however if it is the active window then it will start to receive the keys. Soon as I click on another window it stops receiving keystrokes, and when I make it active again it starts receiving again. I tried this with other applications and ended up with the same results. I am Admin on this cpu running Windows 7 64-bit. I noticed to for whatever reason, when the script is running sometimes it will randomly start turning my caps key on or off(very annoying ><).

Share this post


Link to post
Share on other sites
PsaltyDS

Be more specific about the window and especially the control you are sending to:

HotKeySet("{ESC}", "_Quit")

while 1
    ControlSend("[CLASS:Notepad; Title:Untitled - Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "l")
    sleep(1000)
WEnd

Func _Quit()
    Exit
EndFunc

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
senatorwolf

Be more specific about the window and especially the control you are sending to:

HotKeySet("{ESC}", "_Quit")

while 1
    ControlSend("[CLASS:Notepad; Title:Untitled - Notepad]", "", "[CLASS:Edit; INSTANCE:1]", "l")
    sleep(1000)
WEnd

Func _Quit()
    Exit
EndFunc

;)

When i use your controlsend it works, thanks =)

Share this post


Link to post
Share on other sites
seandisanti

When i use your controlsend it works, thanks =)

for notepad i typically use ControlSetText rather than even ControlSend, because it's instant, and you don't have to worry about the cursor getting moved and screwing up your send

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.