Jump to content

Recommended Posts

Posted (edited)

ControlSend doesn't send {ALTDOWN} but it will send characters (a-z).

Why is that?

Also, Send("{ALTDOWN}" works.

Edited by Leomund
Posted (edited)

You should read.

ControlSend: Sends a string of characters to a control

Send: Sends simulated keystrokes to the active window.

Edited by Danyfirex
Posted (edited)

Sorry, I don't get why the difference between control and active window is important. Also, ControlSend('!') works with notepad. Extrapolate? I've read.

(I tried to use winspector with my telnet but nothing? I'm guessing I have to find some other way of sending commands.)

Edited by Leomund
Posted (edited)
difference is that control can be anything inside of a windows. maybe a textbox,listbox. do you understand? Edited by Danyfirex
Posted

Hmm, yeah. I think I understand. I'm still confused as to why it will send a character but not alt key, using same controlID (handle).

Posted

look this example ;)

Run(@WindowsDir & "notepad.exe", "", @SW_MAXIMIZE)
WinWaitActive("[CLASS:Notepad]")
Send("Today's time/date is {F5} {ENTER}") ; here I simulate the key "f5" if you lock in notepad-edition-f5 return the time/date
ControlSend("[CLASS:Notepad]", "", "Edit1", "This is a line of text in the notepad window F5 ENTER") ;here I use controlsend to send string of characters.
Posted

ControlSend("[CLASS:Notepad]","","Edit1",'!f')

It doesn't seem I'm going to solve my problem. Thanks though.

I would be a little surprised if I'm really not supposed to use controlsend for the ALT key.

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
×
×
  • Create New...