Jump to content

ControlSendPlus


Recommended Posts

Hi All,

Here is a snippet of the script.

#include "ControlSendPlus.au3"

Run('control inetcpl.cpl')

WinWaitActive("Internet Properties")

ControlSendPlus("Internet Properties", "", "", "^{TAB}", 0)

ControlSendPlus("Internet Properties", "", "", "{RIGHT}", 0)

ControlSendPlus("Internet Properties", "", "", "{RIGHT}", 0)

This is the first part of the script to change some settings in the internet properties. I am trying to get the ControlSend Plus to send a right arrow to the window. But to no avail. I have tried Control Send, can't get it to work, Send does work but I have concerns it will just keep sending the keystrokes if the window did get interupted and lost focus, unless I add WinWaitActive before each keystroke.

What I fing strange is that the first ^{TAB} is successful.

Thanks for quick help.

Edited by hispeed_mike
Link to comment
Share on other sites

you could do a waitwinactive after every key send if you are worried it will fail... ie. you could wait for a text match in the window. (I guess it's what ControlSendPlus does?)

> there are 10 types of people in the world, those who understand binary and those who don't.

Link to comment
Share on other sites

ye.. what does ControlSendPlus do actually..

its not a standard Func.

It piggy back off of ControlSend with some added extras.

With this type of automation is there a cleaner way of accomplishing this that will make sure the right keystroke goes to the right window?

I know I can WinWaitactive even make it active, but is there a coder that could show me the light so to speak to accomplish this? or should I just WinWaitActive in between each keystroke?

Cheers for thoughts....

Link to comment
Share on other sites

  • Moderators

It piggy back off of ControlSend with some added extras.

With this type of automation is there a cleaner way of accomplishing this that will make sure the right keystroke goes to the right window?

I know I can WinWaitactive even make it active, but is there a coder that could show me the light so to speak to accomplish this? or should I just WinWaitActive in between each keystroke?

Cheers for thoughts....

With ControlSend() you don't need the window to be active, otherwise you could just use Send(). WinWait() should be fine.

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.

Link to comment
Share on other sites

  • Moderators

So can you get ControlSend to send {RIGHT} key according to script above?

Worked for me when I tried it in SciTe
ControlSend("C:\Documents and Settings\SmOke_N\Desktop\test.au3 - SciTE [1 of 1]", '', 'Scintilla1', '{RIGHT}')
Notice, if you're sending to a control, then use the Control ID or ClassNameNN, you didn't fill any of the parameters in above, thus defeating the purpose of ControlSend() really, and really only taking advantage of an option that normally wouldn't be there. Edited by SmOke_N

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.

Link to comment
Share on other sites

Worked for me when I tried it in SciTe

ControlSend("C:\Documents and Settings\SmOke_N\Desktop\test.au3 - SciTE [1 of 1]", '', 'Scintilla1', '{RIGHT}')
Notice, if you're sending to a control, then use the Control ID or ClassNameNN, you didn't fill any of the parameters in above, thus defeating the purpose of ControlSend() really, and really only taking advantage of an option that normally wouldn't be there.
To miss the obvious, While I have your attention, how do I list the inetcpl.cpl. Is the Window name really Internet Properties, what is the Control ID and ClassNameNN?

I say this because I just ran a test of winwait with a period of 7 seconds. Even after the 7 seconds the script didn't continue telling me that controlsendplus cannot see the Internet Properties window.

I am getting no problems when using Command prompt etc, Just seems to be doin my head in on how to get the right window name to send to...

Thanks for the heads up. I am just stating to take scripting seriously.

Appreciate the help.

Edited by hispeed_mike
Link to comment
Share on other sites

  • Moderators

To miss the obvious, While I have your attention, how do I list the inetcpl.cpl. Is the Window name really Internet Properties, what is the Control ID and ClassNameNN?

I say this because I just ran a test of winwait with a period of 7 seconds. Even after the 7 seconds the script didn't continue telling me that controlsendplus cannot see the Internet Properties window.

I am getting no problems when using Command prompt etc, Just seems to be doin my head in on how to get the right window name to send to...

Thanks for the heads up. I am just stating to take scripting seriously.

Appreciate the help.

Run(@ComSpec & ' /c inetcpl.cpl', '', @SW_HIDE)
You also may want to look at ControlCommand().

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.

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