silvano Posted December 14, 2006 Share Posted December 14, 2006 hello, I have a little problem... How I can apply the modify that screensaver show after one minutes before launch script setting? tks, this is the code expandcollapse popup$text = InputBox("TEST ","Insert text") If @error Then $sq = "test" Else $sq = $text EndIf $key = "HKEY_CURRENT_USER\Software\Microsoft\Screensavers\Text3D" $key2 = "HKEY_CURRENT_USER\Software\Microsoft\Screensavers\Text3D\Screen 1" RegWrite($key,"AllScreensSame","REG_DWORD",0) RegWrite($key,"SurfaceType","REG_DWORD",1) RegWrite($key,"Specular","REG_DWORD",1) RegWrite($key,"SurfaceColor","REG_DWORD","7829367") RegWrite($key,"CustomTexture","REG_SZ","") RegWrite($key,"CustomEnvironment","REG_SZ","") RegWrite($key,"UseCustomColor","REG_DWORD",0) RegWrite($key,"UseCustomTexture","REG_DWORD",0) RegWrite($key,"UseCustomEnvironment","REG_DWORD",0) RegWrite($key,"MeshQuality","REG_DWORD","500") RegWrite($key,"Size","REG_DWORD","10") RegWrite($key,"RotationSpeed","REG_DWORD","10") RegWrite($key,"RotationStyle","REG_DWORD",1) RegWrite($key,"DisplayString","REG_SZ",$sq) RegWrite($key,"DisplayTime","REG_DWORD",0) RegWrite($key,"FontWeight","REG_DWORD","700") RegWrite($key,"FontHeight","REG_DWORD","4294967200") RegWrite($key,"FontItalic","REG_DWORD",0) RegWrite($key,"FontCharSet","REG_DWORD","16909056") RegWrite($key,"FontPitchFamily","REG_DWORD","1627411490") RegWrite($key,"FontFace","REG_SZ","Tahoma") RegWrite($key2,"Leave Black","REG_DWORD",0) RegWrite($key2,"Disable Hardware","REG_DWORD",0) RegWrite($key2,"Width","REG_DWORD",0) RegWrite($key2,"Height","REG_DWORD",0) RegWrite($key2,"Format","REG_DWORD",0) ; now I wuold like to apply modify and run screensaver after one minute... Link to comment Share on other sites More sharing options...
silvano Posted December 15, 2006 Author Share Posted December 15, 2006 up please... Link to comment Share on other sites More sharing options...
The Kandie Man Posted December 15, 2006 Share Posted December 15, 2006 (edited) How I can apply the modify that screensaver show after one minutes before launch script setting?I would assume nobody has replied because we don't understand want you mean. I, for example, don't know what you mean by that sentence. Do you want to run the screensaver, wait one minute, and then change its settings in the registry? Edited December 15, 2006 by The Kandie Man "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
silvano Posted December 15, 2006 Author Share Posted December 15, 2006 sorry for my bad english, this script set screensaver same 3D text, text, font, time to run... etc... but the problem is that scrennsaver not run after one minute, because I don't must set 'apply' (similar desktop right click --> properties --> display Properties' --> screen Saver --> (select)--> apply button) How I to apply immediately the change after script run? Link to comment Share on other sites More sharing options...
silvano Posted December 19, 2006 Author Share Posted December 19, 2006 any idea!? up please Link to comment Share on other sites More sharing options...
James Posted December 19, 2006 Share Posted December 19, 2006 Sleep(1000000) USe the sleep function maybe? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
martin Posted December 19, 2006 Share Posted December 19, 2006 any idea!?up pleaseI think you need to set the registry value for the screen saver time delay. Setting the registry values applies the changes, there is no need for any 'apply' method.HKEY_USERS\.DEFAULT\Control Panel\Desktop\ScreenSaveTimeOutThis is the time in seconds, the default is 600, you need to set it to 60. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
silvano Posted December 19, 2006 Author Share Posted December 19, 2006 (edited) I think you need to set the registry value for the screen saver time delay. Setting the registry values applies the changes, there is no need for any 'apply' method. HKEY_USERS\.DEFAULT\Control Panel\Desktop\ScreenSaveTimeOut This is the time in seconds, the default is 600, you need to set it to 60. the time delay is already set by my script, but the modify start/apply only after reboot machine but the screen saver not start... There is not way to apply modify immediately? like Call dll, or other? this is my compelte script: thanks expandcollapse popup$key = "HKEY_CURRENT_USER\Software\Microsoft\Screensavers\Text3D" $key2 = "HKEY_CURRENT_USER\Software\Microsoft\Screensavers\Text3D\Screen 1" $key3 = "HKEY_CURRENT_USER\Control Panel\Desktop" FileInstall("C:\cdftp\test.bmp", "C:\test.bmp") RegWrite($key,"AllScreensSame","REG_DWORD",0) RegWrite($key,"SurfaceType","REG_DWORD",1) RegWrite($key,"Specular","REG_DWORD",1) RegWrite($key,"SurfaceColor","REG_DWORD","7829367") RegWrite($key,"CustomTexture","REG_SZ","") RegWrite($key,"CustomEnvironment","REG_SZ","") RegWrite($key,"UseCustomColor","REG_DWORD",0) RegWrite($key,"UseCustomTexture","REG_DWORD",0) RegWrite($key,"UseCustomEnvironment","REG_DWORD",0) RegWrite($key,"MeshQuality","REG_DWORD","500") RegWrite($key,"Size","REG_DWORD","10") RegWrite($key,"RotationSpeed","REG_DWORD","10") RegWrite($key,"RotationStyle","REG_DWORD",1) RegWrite($key,"DisplayString","REG_SZ","My text here") RegWrite($key,"DisplayTime","REG_DWORD",0) RegWrite($key,"FontWeight","REG_DWORD","700") RegWrite($key,"FontHeight","REG_DWORD","4294967200") RegWrite($key,"FontItalic","REG_DWORD",0) RegWrite($key,"FontCharSet","REG_DWORD","16909056") RegWrite($key,"FontPitchFamily","REG_DWORD","1627411490") RegWrite($key,"FontFace","REG_SZ","Tahoma") RegWrite($key2,"Leave Black","REG_DWORD",0) RegWrite($key2,"Disable Hardware","REG_DWORD",0) RegWrite($key2,"Width","REG_DWORD",0) RegWrite($key2,"Height","REG_DWORD",0) RegWrite($key2,"Format","REG_DWORD",0) ;RegWrite($key2,"Adapter ID"=hex:3e,1e,b7,d7,6c,43,cf,11,47,65,78,20,b4,c2,cb,35 RegWrite($key3,"ScreenSaveTimeOut","REG_SZ","60") RegWrite($key3,"ScreenSaveActive","REG_SZ","1") RegWrite($key3,"Wallpaper","REG_SZ","C:\test.bmp") Edited December 19, 2006 by silvano Link to comment Share on other sites More sharing options...
martin Posted December 19, 2006 Share Posted December 19, 2006 (edited) Yes you're right, I think you would normally have to log out then in again to make the changes apply. I'm afraid I don't know the way round this. Maybe you should set the values using SystemParametersInfo. Microsoft suggests using this to progammatically change such things. There are examples of its use in the forum. Edited December 19, 2006 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
silvano Posted December 19, 2006 Author Share Posted December 19, 2006 Yes you're right, I think you would normally have to log out then in again to make the changes apply. I'm afraid I don't know the way round this.Maybe you should set the values using SystemParametersInfo. Microsoft suggests using this to progammatically change such things.There are examples of its use in the forum.thanks martin!this is solution for wallpaper and work it!DllCall("User32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "string", "path img", "int", 0x01)but I have not search result for screen saver apply solution.. :-( Link to comment Share on other sites More sharing options...
martin Posted December 19, 2006 Share Posted December 19, 2006 (edited) thanks martin!this is solution for wallpaper and work it!DllCall("User32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "string", "path img", "int", 0x01)but I have not search result for screen saver apply solution.. :-(I think this works $DelayTime = 20;20sec DllCall("user32.dll", "int", "SystemParametersInfo", "int", 15, "int", $DelayTime , "int", 0, "int", 2)where 15 is the value for SPI_SETSCREENSAVETIMEOUT Edited December 19, 2006 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
silvano Posted December 20, 2006 Author Share Posted December 20, 2006 I think this works $DelayTime = 20;20sec DllCall("user32.dll", "int", "SystemParametersInfo", "int", 15, "int", $DelayTime , "int", 0, "int", 2)where 15 is the value for SPI_SETSCREENSAVETIMEOUTthanks martin but don't work it :-(I have used Run("control.exe desk.cpl") with WinWait func and Send() funcbut this is not a pretty solution... Link to comment Share on other sites More sharing options...
martin Posted December 20, 2006 Share Posted December 20, 2006 thanks martin but don't work it :-(I have used Run("control.exe desk.cpl") with WinWait func and Send() funcbut this is not a pretty solution...I've tried DllCall("user32.dll", "int", "SystemParametersInfo", "int", 15, "int", $DelayTime , "int", 0, "int", 2) with values from 20 to 120 and it works fine for me. Provided I use a vlue > 60 I can see the change by selecting screensaver in desktop properties. Less than 60 and I can see the effect by just waiting for the time.Are you sure it doesn't work for you? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
silvano Posted December 20, 2006 Author Share Posted December 20, 2006 I've tried DllCall("user32.dll", "int", "SystemParametersInfo", "int", 15, "int", $DelayTime , "int", 0, "int", 2) with values from 20 to 120 and it works fine for me. Provided I use a vlue > 60 I can see the change by selecting screensaver in desktop properties. Less than 60 and I can see the effect by just waiting for the time.Are you sure it doesn't work for you?yes, don't workI used value like 20, 60, 100, 120 but without results... in the screensaver desktop properties don't watch the setting DllCall change.Don't worry... is only for little play. thank a lot 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