Sign in to follow this  
Followers 0
vmguy

ControlClick not working on Windows control panels (.cpl)

5 posts in this topic

#1 ·  Posted (edited)

Not the way I want to spend my energies. -Bye

Edited by vmguy

Share this post


Link to post
Share on other sites



Looking at your script reveal that you have to wait active windows before using SEND.

I see a lot of WinWait which should have a WinWaitActive same with WinActivate.

Please reread the doc about those functions.

Share this post


Link to post
Share on other sites

Have you tryed just sending enter? That usually applies the options and clicks OK.

Share this post


Link to post
Share on other sites

Or you could do something like this:

$Internet="Internet Properties"
$LAN="Local Area Network (LAN) Settings"

Run("RunDll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,4")
WinWaitActive($Internet)
ControlClick($Internet, "", "Button13")
WinWaitActive($LAN)
ControlClick($LAN, "", "Button8" )
ControlClick($LAN, "", "Button12")
WinWaitActive($Internet)
ControlClick($Internet, "", "Button14")

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

Here is the working script. In my examples above, I biff'd the [OK] Control ID.

It is essential to wait until $LAN closes, or $Internet will not respond to OK.

; Internet Options _DO_ respond to ControlClick
$Internet="Internet Properties"
$LAN="Local Area Network (LAN) Settings"
Run('rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,4') 

 WinWaitActive($Internet)
  ControlClick($Internet, "", 1580)  ;; Lan Settings
 
 WinWaitActive($LAN)  
ControlCommand($LAN,"",1570,"Check") ;; Use Proxy 
  ControlClick($LAN,"",1)            ;; OK
  WinWaitClose($LAN)  
 
  ControlClick($Internet, "", 1)     ;; OK

Thanks for all the help.

We're probably using different versions of Windows, which would explain the differences in buttons. Glad I could be of help though.

Auto3Lib: A library of over 1200 functions for AutoIt

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