Jump to content

Send/ControlSend/ControlClick not working in my pc.


Go to solution Solved by FireFox,

Recommended Posts

Posted

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.

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

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
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
  • Solution
Posted (edited)

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

Edited by FireFox

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
×
×
  • Create New...