masken Posted January 14, 2005 Share Posted January 14, 2005 Okay, I'm totally new in AutoIt. As a first project, I'd like to make a script that enters the control panel's "mouse" alternatives - or simply the applet "main.cpl", browses to the tab "Wheel", sets 4 rows for scrolling, and presses Enter. Is this possible? I managed to do this: Run("control.exe main.cpl") Then I guess I should use ControlCommand ( ) in some fashion? Link to comment Share on other sites More sharing options...
sandyd Posted January 14, 2005 Share Posted January 14, 2005 (edited) Try this, pretty crude but works! Run("control.exe main.cpl") WinWaitActive("Mouse Properties","") Send("^{TAB}^{TAB}^{TAB}") ControlSetText("Mouse Properties","","Edit1","4") Send("{ENTER}") Edit: Added code block around code Edited January 14, 2005 by sandyd ----[ SandyD ]--- Link to comment Share on other sites More sharing options...
CyberSlug Posted January 14, 2005 Share Posted January 14, 2005 Tested on WinXP Pro sp1... might not work on all computers (especially laptops).Run("control.exe main.cpl") WinWait("Mouse Properties") WinSetState("Mouse Properties","",@SW_HIDE) ControlCommand("Mouse Properties","","SysTabControl321","TabRight","") ControlCommand("Mouse Properties","","SysTabControl321","TabRight","") ControlCommand("Mouse Properties","","SysTabControl321","TabRight","") ControlSetText("Mouse Properties","","Edit1","3") ControlClick("Mouse Properties","","OK")You should be able to do this more directly by writing the appropriate registry key, but I don't know how to tell Windows to refresh and use the new value...RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop","WheelScrollLines","REG_SZ", "3") Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
masken Posted January 16, 2005 Author Share Posted January 16, 2005 Thanks alot for the tips Two different ways of achieving the goal, nice @CyberSlug, yeah I've used regmon to see what's going on, but I couldn't get anything out of it. I don't know how Win refreshes hives either. @CyberSlug, could you please explain shortly what the ControlCommand() does here? Link to comment Share on other sites More sharing options...
CyberSlug Posted January 17, 2005 Share Posted January 17, 2005 @CyberSlug, could you please explain shortly what the ControlCommand() does here? <{POST_SNAPBACK}>Control command is more reliable than sending key strokes becuase the window can does not have to be active or even visible.1) Using the AutoIt Window Spy/Info tool, I checked the "name" of the tab control: SysTabControl321I call "TabRight" three times which, as documented in the help file, activates the next tab2) The other two linesControlSetText("Mouse Properties","","Edit1","3")ControlClick("Mouse Properties","","OK")should be pretty self explanatory. NOTE: In your case, you would want to change 3 to 4.3) The reason I hide the mouse window after it appears is because my computer seeems to hang for a half-second when the OK button on the mouse properties window is clicked.By the way, here's an improvement based on this informationRun("control.exe main.cpl,@0,2") ;Launch mouse properites with third tab open WinWait("Mouse Properties") WinSetState("Mouse Properties","",@SW_HIDE) ControlSetText("Mouse Properties","","Edit1","4") ControlClick("Mouse Properties","","OK") Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
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