Jump to content

ControlClick not working on Windows control panels (.cpl)


vmguy
 Share

Recommended Posts

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.

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