Sign in to follow this  
Followers 0
adrigalilea

Send/ControlSend/ControlClick not working in my pc.

8 posts in this topic

I've tried this code, and some variants to get it working, and I'm stuck.

Opt("WinTitleMatchMode", 4)

Run("control sysdm.cpl,,3")
WinWaitActive("classname=#32770")
$handle = WinGetHandle("active")

ControlClick($handle,"","[CLASS:Button; INSTANCE:2]")

Tried clicking, controlclicking, sending enter, sending "!o"... and nothing seems to work in that pc.

I've tried in another pc and it works.

Please help.

Share this post


Link to post
Share on other sites



Try using the correct syntax as explained in the help file

WinWaitActive("[CLASS:#32770]")
$handle = WinGetHandle("[active]")

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

 

Try using the correct syntax as explained in the help file

WinWaitActive("[CLASS:#32770]")
$handle = WinGetHandle("[active]")

Still not working, the problem is not the winwait, the problem is the button is not pressed/activated.

EDIT: Even with a normal MouseClick nothing seems to happen.

Edited by adrigalilea

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

it opens "visual effects" tab in my pc. seems to work, if you wanted that.

edit: even in your first version, that was judged as being wrong

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

it opens "visual effects" tab in my pc. seems to work, if you wanted that.

That's exactly what i want, but dont work in mine... Tested in my Windows7 and Windows 8...

EDIT: #RequireAdmin, and suddenly it works.. I'm getting crazy on this one, could someone explain me why it does not work without requireadmin? does not make sense to me...

Edited by adrigalilea

Share this post


Link to post
Share on other sites

You need to debug the script and see where it fails :

Run("control sysdm.cpl,,3")
 
WinWaitActive("[CLASS:#32770]")
 
Local $hWnd = WinGetHandle("[active]")
ConsoleWrite("Title: " & WinGetTitle($hWnd) & @CrLf)
 
Local $iRet = ControlClick($hWnd, "", "[CLASS:Button; INSTANCE:2]")
ConsoleWrite("Ret: " & $iRet & ", error code: " & @error & @CrLf)

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

 

You need to debug the script and see where it fails :

Run("control sysdm.cpl,,3")
 
WinWaitActive("[CLASS:#32770]")
 
Local $hWnd = WinGetHandle("[active]")
ConsoleWrite("Title: " & WinGetTitle($hWnd) & @CrLf)
 
Local $iRet = ControlClick($hWnd, "", "[CLASS:Button; INSTANCE:2]")
ConsoleWrite("Ret: " & $iRet & ", error code: " & @error & @CrLf)

Hi FireFox, i've readed a lot of your work, thank you for the help, sorry i've never played with consolewrite, but sounds like i should in near future  o:)

When i run it from scite:

Ret: 1, error code: 0 (everything fine i guess.)

And as i said in last post, it's working when i use #RequireAdmin. If i don't write requireadmin the script just ends without clicking the button... Why that happens?

Edited by adrigalilea

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Your account may be restricted for this action, hence you need to elevate to administrator.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

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