Sign in to follow this  
Followers 0
silvano

screensaver apply modify

14 posts in this topic

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

$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...

Share this post


Link to post
Share on other sites



up please...

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

any idea!?

up please

Share this post


Link to post
Share on other sites

any idea!?

up please

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.


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.

Share this post


Link to post
Share on other sites

#8 ·  Posted (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

$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 by silvano

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

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.. :-(

Share this post


Link to post
Share on other sites

#11 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

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

thanks martin but don't work it :-(

I have used Run("control.exe desk.cpl") with WinWait func and Send() func

but this is not a pretty solution...

Share this post


Link to post
Share on other sites

thanks martin but don't work it :-(

I have used Run("control.exe desk.cpl") with WinWait func and Send() func

but 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.

Share this post


Link to post
Share on other sites

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 work

I 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 :P

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0