Sani Posted February 16, 2006 Share Posted February 16, 2006 Hello I am very new in AutoIt so excuse my ignorance. On user computers, I need to automaically set screen saver Windows XP with the delay 25minutes.I cannot find a way how to overwrite pre-existing delay value users might have. Here is my attempt script ( the field Wait has an Control ID 1306):Run("control.exe desk.cpl,,2")WinWait("Display Properties", "Screen Saver")ControlCommand("Display Properties", "Screen Saver", "ComboBox1", "SelectString", "Windows XP")ControlFocus("Display Properties", "Screen Saver", 1306)ControlSend("Display Properties", "Screen Saver", 1306, "25")The function ControlFocus, just puts cursor at the first position, and function ControlSent inserts a string 25, so for example if preexisting delay was 30, I get the result 2530 - which is not good.If I use function Send("{TAB 3}") instead the function ControlFocus it works. However, I do not like sending TABs because after other operations in the window the number of tabs may vary.Any ideas?Thanks for replies Link to comment Share on other sites More sharing options...
evilertoaster Posted February 16, 2006 Share Posted February 16, 2006 you could have the mouse double click on whatever is curretly there, that should make it highlighted and then whatever you enter would overwrite it. Or you could regwrite the key -HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveTimeOut and set how many seconds to wait. Link to comment Share on other sites More sharing options...
Sani Posted February 16, 2006 Author Share Posted February 16, 2006 (edited) you could have the mouse double click on whatever is curretly there, that should make it highlighted and then whatever you enter would overwrite it. Or you could regwrite the key-HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveTimeOutand set how many seconds to wait.Thanks, I really like idea of mouse double-click. I have tried the functionControlClick("Display Properties", "Screen Saver", 1306, "left", 2) but it does not work.Well, how to double-click a control? Edited February 16, 2006 by Sani Link to comment Share on other sites More sharing options...
evilertoaster Posted February 19, 2006 Share Posted February 19, 2006 you might need to givefocus first and then click 1 time and then sleep(10) and then click agian. I tried this right quick and it seemed to work ControlFocus ( "Display Properties", "Screen Saver", 1306 ) ControlSend ( "Display Properties", "Screen Save", 1306, "+{right}+{right}+{right}15" ) Link to comment Share on other sites More sharing options...
Sani Posted February 19, 2006 Author Share Posted February 19, 2006 Hello Evilertoaster Giving focus first and then clicking 1 time and then sleep(10) and then click again does not work. However, your code with sending keystroke works OK. Perhaps some improvement: ControlSend ( "Display Properties", "Screen Save", 1306, "+{END}15" ) Instead sending several Shift+Left key strokes, you can send one Shift+End stroke. Thanks for idea. Sani 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