Jump to content

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


Abhay
 Share

Recommended Posts

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

Link to comment
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.

Link to comment
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)

Link to comment
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.

Link to comment
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?

Link to comment
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
Link to comment
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?

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...