Jump to content
Sign in to follow this  
Leomund

ControlSend Alt no A yes

Recommended Posts

Leomund

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

Why is that?

Also, Send("{ALTDOWN}" works.

Edited by Leomund

Share this post


Link to post
Share on other sites
Danyfirex

You should read.

ControlSend: Sends a string of characters to a control

Send: Sends simulated keystrokes to the active window.

Edited by Danyfirex

Share this post


Link to post
Share on other sites
Leomund

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

Share this post


Link to post
Share on other sites
Danyfirex
difference is that control can be anything inside of a windows. maybe a textbox,listbox. do you understand? Edited by Danyfirex

Share this post


Link to post
Share on other sites
Leomund

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).

Share this post


Link to post
Share on other sites
Danyfirex

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.

Share this post


Link to post
Share on other sites
Leomund

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.

Share this post


Link to post
Share on other sites
Danyfirex

what do you want to make exactly?

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  

×