Sign in to follow this  
Followers 0
Abhay

Can I send keys like {ENTER} or {TAB} or "!a" etc by using ControlSend()?

17 posts in this topic

Can I send keys like {ENTER} or {TAB} or "!a" etc by using ControlSend()?

I want to navigate through different screens so let me know if I can do that.

Share this post


Link to post
Share on other sites



Can I do controlsend based on object ID?

ControlSend ( "title", "text", controlID, "string" [, flag] )

You can obtain the Title and controlID with the AU3Info Tool (Au3InfoA.exe) located in the au3 install dir.

Best Regards

Share this post


Link to post
Share on other sites

Whats the significance of flag "0" and "1".

I tried that but it didn't work.

ControlSend("CommandCentral", "Next", 3668, "{ENTER}", 0)

Share this post


Link to post
Share on other sites

Whats the significance of flag "0" and "1".

I tried that but it didn't work.

ControlSend("CommandCentral", "Next", 3668, "{ENTER}", 0)

0 is you want to send special text like SHIFT, ALT and other like this.

1 is if you want to send raw text.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

ControlSend("CommandCentral", "Next", 3668, "{ENTER}", 0)

Here I am trying to send Enter to Next button, why it is not happening?

Share this post


Link to post
Share on other sites

The syntax looks right, so I guess the control can not be found. If

msgbox(0,"",ControlSend("CommandCentral", "Next", 3668, "{ENTER}", 0)) gives you a 0 that's the case.

Maybe try

ControlSend("CommandCentral", "&Next", 3668, "{ENTER}", 0)

or

ControlSend("CommandCentral", "", 3668, "{ENTER}", 0)

Share this post


Link to post
Share on other sites

The second parameter "Text" is not used to find the control, but it is used to find the window. Entering "Next" there will cause it to fail to find the window.

ControlSend("CommandCentral", "", 3668, "{ENTER}")

Share this post


Link to post
Share on other sites

Tried those things guys, still not!

Share this post


Link to post
Share on other sites

The control might first need to be given focus with the ControlFocus command, specially when referencing an controlID created by the script itself.

?

Share this post


Link to post
Share on other sites

Tried those things guys, still not!

Try removing all references to a specific program from your ControlSend()

IE:ControlSend("NotePad","","","TestTest")

I've had a few video games I was making bots for that didn't have controls to get, and the command still works without it.

Share this post


Link to post
Share on other sites

For notepad its easy as we are just sending text. What I want to accomplkish here is that there is a button next, I want to send ENTER to it to go to the next screen.

Any idea?

Share this post


Link to post
Share on other sites

post the content of the AU3Info Tool

Share this post


Link to post
Share on other sites

>>>> Window <<<<

Title: CommandCentral

Class: #32770

Position: 193, 128

Size: 639, 478

Style: 0x94CA02C4

ExStyle: 0x00010101

Handle: 0x00050398

>>>> Control <<<<

Class: Button

Instance: 11

ClassnameNN: Button11

Advanced (Class): [CLASS:Button; INSTANCE:11]

ID: 3668

Is this enough?

Share this post


Link to post
Share on other sites

>>>> Window <<<<

Title: CommandCentral

Class: #32770

Position: 193, 128

Size: 639, 478

Style: 0x94CA02C4

ExStyle: 0x00010101

Handle: 0x00050398

>>>> Control <<<<

Class: Button

Instance: 11

ClassnameNN: Button11

Advanced (Class): [CLASS:Button; INSTANCE:11]

ID: 3668

Is this enough?

ControlClick("CommandCentral", "", "Button11")

I guess you could try ControlSend(), but why? ControlClick() is the usual way to click a button control.

:)


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

ControlClick("CommandCentral", "", "Button11")

I guess you could try ControlSend(), but why? ControlClick() is the usual way to click a button control.

:)

ControlClick("CommandCentral", "", "Button11") <----------------- This doesn't work, did you try it at your end?

Share this post


Link to post
Share on other sites

ControlClick("CommandCentral", "", "Button11") <----------------- This doesn't work, did you try it at your end?

I have used ControlClick() many times, yes. But I don't know what "CommandCentral" is, so I couldn't test it in that context. What is the app you are working with?

:)


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

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