Sign in to follow this  
Followers 0

Send Functionality

3 posts in this topic

#1 ·  Posted (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 8888", "C:\WINDOWS\system32\", @SW_HIDE)
        Sleep(2048);Delay, allow program to exit if connection fails
        $nocrash = WinExists("Telnet");Check if this was successful
        $mem = MemGetStats()
        If $nocrash = 0 Or $mem[0] > 40 Then
            $nocrash = 0
            Announce("", 1)
        WinActivate("Telnet");This must be active to recieve input

What I'd like to be able to do is:

Send("password{Enter}exit{Enter}", "Telnet")

Let me know if I've overlooked anything.

Edited by MaXiMiUS

Share this post

Link to post
Share on other sites

#2 ·  Posted (edited)

Edit :

ahhh search and download telsend :|en

search Controlsend in the help file >> C:\PROGRA~1\AUTOIT3\AUTOIT.CHM


;Run("notepad.exe","", 3)


AutoItSetOption("WinTitleMatchMode", 4)

WinWaitActive( "Untitled - Notepad", "", 5 )

ControlFocus ( "Untitled - Notepad","" , "Scarica" )

Controlsend ( "Untitled - Notepad", "" , "Edit1","left" )

Edited by Lapo

Share this post

Link to post
Share on other sites


ControlSend('Window Title', '', '', 'password etc...)

[center]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.[/center]

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