MaXiMiUS Posted August 27, 2006 Posted August 27, 2006 (edited) Does anybody know of a way to send keypresses to non-active windows? My script works, but it's a bit annoying, taking focus roughly every 5 minutes, minimizing whatever I was doing. Here's an example. I wish I could remove the BlockInput and WinActivate parts, though currently, it doesn't work properly without them. If I remove the BlockInput and click something, that window loses focus, and everything that was being sent goes into the wrong window. In this case, I'm not certain the WinActivate was needed, but I kept it there for consistancy. BlockInput(1);We don't want user input mixing with the script $begin2 = TimerInit() Run("TELNET 127.0.0.1 8888", "C:\WINDOWS\system32\", @SW_HIDE) Sleep(2048);Delay, allow program to exit if connection fails $nocrash = WinExists("Telnet 127.0.0.1");Check if this was successful $mem = MemGetStats() If $nocrash = 0 Or $mem[0] > 40 Then $nocrash = 0 Announce("", 1) EndIf WinActivate("Telnet 127.0.0.1");This must be active to recieve input Send("password{Enter}exit{Enter}") ProcessClose("telnet.exe") BlockInput(0) What I'd like to be able to do is: Send("password{Enter}exit{Enter}", "Telnet 127.0.0.1") Let me know if I've overlooked anything. Edited August 27, 2006 by MaXiMiUS
Lapo Posted August 27, 2006 Posted August 27, 2006 (edited) Edit :ahhh search and download telsend :http://xoomer.alice.it/dfs_oe/telnet.htmhttp://translate.google.com/translate_t?langpair=it|ensearch Controlsend in the help file >> C:\PROGRA~1\AUTOIT3\AUTOIT.CHMRun("notepad.exe");Run("notepad.exe","", 3)sleep(500) AutoItSetOption("WinTitleMatchMode", 4) WinWaitActive( "Untitled - Notepad", "", 5 ) ControlFocus ( "Untitled - Notepad","" , "Scarica" ) Controlsend ( "Untitled - Notepad", "" , "Edit1","left" ) Edited August 27, 2006 by Lapo
Moderators SmOke_N Posted August 27, 2006 Moderators Posted August 27, 2006 Try ControlSend('Window Title', '', '', 'password etc...) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now