Jump to content
Sign in to follow this  
aur

AGAIN CONTROLCLICK

Recommended Posts

aur

Hi:

I'm new in this forum and in AutoIt and my mother language is spanish, therefor please, excuse me for any gramatical error or

silly questions. I decided that the best way to learn programming in AutiIt is to try it, writing a short and easy program as my

first task and the project consist in a script that let me enter in the Control Panel, open the System and Security page and

make an image of my system. Working with the help file and the postings in the forum I wrote the following:

Dim $milsec

ShellExecute("C:\Users\Angel\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\System Tools\Control panel.lnk")

WinActivate("[CLASS:CabinetWClass]", "")

WinWaitActive("[CLASS:CabinetWClass]")

SLEEP($milsec)

ControlClick("[CLASS:CabinetWClass]","","[CLASS:DirectUIHWND; INSTANCE:2]")

SLEEP($milsec)

ControlClick("[CLASS:CabinetWClass]","","[CLASS:DirectUIHWND; INSTANCE:2]")

Everything was fine until I encountered CONTROLCLICK and its coordinates X/Y. The problem is that Controlclick has as default

value "center" and no matter what coordinates I use in the command, it always click in the center of the page and consequently,

opening absolutely other page that the one I'm interested.

I have been hours in the forum reading everything I encountered about Controlclick, I have used the coordinates in every way it

is possible to imagine and always fail.Any suggestion?.

Thanks a lot in advance for your help!!!!

ANGEL

Share this post


Link to post
Share on other sites
Valuater

Maybe try something different than "Control Panel, System and Security page" as your first project and you might get more help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
trancexx

That's not the way to learn.

Choice of functions to learn AutoIt is terrible. They are "look mum, I'm a hacker" type of functions.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
Fire

aur,

Firstly Welcome To Autoit Community.

I`m not sure is it what you are looking for:

Run("cmd.exe /c " & "wscui.cpl",@SystemDir,@SW_HIDE)
Sleep(800)
WinWaitActive("[CLASS:wscui_class]")
Sleep(800)
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{ENTER}")
Exit

EDIT:runwait to run()

Q:What it does?

A:If your windows update is Turned off It will Turn on it.

Tested on win xp sp2 result successfull for me.

Is it what you are looking for or i misunderstand somethink?

Edited by Sh3llC043r

[size="5"] [/size]

Share this post


Link to post
Share on other sites
FaT3oYCG

Although that method may work it is reliant on current folder layout defaults and windows updates, the best way would be to find the icon by name etc. and then open the root application, or just do that straight from the windows folder, much easier and it wont get broken by updates etc.

p.s. @OP Why did you put the thread title in CAPS LOCK?

Edited by FaT3oYCG

Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right.

Share this post


Link to post
Share on other sites
aur

Hi friends:

Thanks a lot for your answers, particularly Sh3llC043r, what a name!!!; it helped me a lot and today I had some improvements.

I think that this problem could be solved very easy with ControlClick but it seems that doesn't work, al least in my hands.

Why I used Caps Lock in the thread title?... for no particular reason, Is there any problem with that?. I'll keep in contact and post the results.

Thanks again.

Angel

Share this post


Link to post
Share on other sites
JohnOne

Caps lock projects one, or both of two things.

You are shouting and/or you think your post deserves more attention than others.

Not saying that was your intention, but thats what it is deemed.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
BrettF

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.