Jump to content

AGAIN CONTROLCLICK


 Share

Recommended Posts

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

Link to comment
Share on other sites

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]
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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