adrigalilea Posted August 4, 2013 Posted August 4, 2013 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.
mikell Posted August 4, 2013 Posted August 4, 2013 Try using the correct syntax as explained in the help file WinWaitActive("[CLASS:#32770]") $handle = WinGetHandle("[active]")
adrigalilea Posted August 4, 2013 Author Posted August 4, 2013 (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 August 4, 2013 by adrigalilea
Edano Posted August 4, 2013 Posted August 4, 2013 (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 August 4, 2013 by Edano [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]
adrigalilea Posted August 4, 2013 Author Posted August 4, 2013 (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 August 4, 2013 by adrigalilea
FireFox Posted August 4, 2013 Posted August 4, 2013 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)
adrigalilea Posted August 4, 2013 Author Posted August 4, 2013 (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 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 August 4, 2013 by adrigalilea
Solution FireFox Posted August 4, 2013 Solution Posted August 4, 2013 (edited) Your account may be restricted for this action, hence you need to elevate to administrator. Edited August 4, 2013 by FireFox
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now