bmueller Posted February 20, 2009 Posted February 20, 2009 (edited) Hi folks, i wrote a little script to switch the primary monitor in Vista. I need to click at the control [CLASS:Monitor32; INSTANCE:2] which changes to [CLASS:Monitor32; INSTANCE:1] after a click on it (the other monitor gets INSTANCE:2 then). Well, sounds quite easy, bt when i use the following command, the settings dialog is opened but no click is performed: Run ("RunDll32.exe shell32.dll,Control_RunDLL desk.cpl") WinWait("Anzeigeeinstellungen") WinActivate("Anzeigeeinstellungen") (...) ControlClick ( "Anzeigeeinstellungen", "", "[CLASS:Monitor32; INSTANCE:2]") What did i do wrong? Thank you very much in advance. Edited February 20, 2009 by bmueller
wraithdu Posted February 20, 2009 Posted February 20, 2009 Same problem. Here's a possible solution, not pretty, but it works. Opt("MouseCoordMode", 2) Run ("RunDll32.exe shell32.dll,Control_RunDLL desk.cpl") WinWait("[CLASS:#32770; TITLE:Display Settings]") $hwnd = WinGetHandle("[CLASS:#32770; TITLE:Display Settings]") $chwnd = ControlGetHandle("Display Settings", "", "Monitor322") $cpos = ControlGetPos($hwnd, "", $chwnd) WinActivate($hwnd) MouseMove($cpos[0] + 5, $cpos[1] + 5, 0) MouseClick("left")
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