#126669 - 2004-09-14 12:48 PM
Screensaver trouble
|
Gos
Fresh Scripter
Registered: 2004-05-28
Posts: 23
|
Code:
$sskey = "HKEY_CURRENT_USER\Control Panel\Desktop"
WriteValue($sskey, "ScreenSaveActive", "1", "REG_SZ") WriteValue($sskey, "ScreenSaveTimeOut", "120", "REG_SZ") WriteValue($sskey, "ScreenSaverIsSecure", "1", "REG_SZ") WriteValue($sskey, "SCRNSAVE.EXE", "C:\WINDOWS\System32\scrnsave.scr", "REG_SZ")
First one: Works Second one: Do not work Third one: Works Fourth one: Do not work
First one: It always turns the screensaver on. Second one: It never changes the time... The time stays as it was before I run the script. Third one: Always sets it to secure. Fourth one: If a screensaver already exist (i.e. screensaver not active) - It set the screensaver to what I wish.
Why does it not work? Any suggestions? Must the values be deleted or something before I can change it?
|
Top
|
|
|
|
#126672 - 2004-09-14 01:47 PM
Re: Screensaver trouble
|
Gos
Fresh Scripter
Registered: 2004-05-28
Posts: 23
|
Quote:
Check the return values of WriteValue() and the value of @ERROR and @SERROR after each call.
You may well not have permission to write / create these keys.
Have done that. It only returns a bunch 0's. Which I believe means it is working correctly. =)
Quote:
how you check that they don't work? if you just look in the GUI after the change, it shouldn't appear there before re-launching shell (as is done in logon).
Not completly sure what you mean, but I go to the GUI of screensaverthingy, yes... Also re-launched that one. I also have the registery up. It shows the timeout has been changed, but not the screensaver.scr
|
Top
|
|
|
|
#126673 - 2004-09-14 01:49 PM
Re: Screensaver trouble
|
Gos
Fresh Scripter
Registered: 2004-05-28
Posts: 23
|
Strange.... Got the *.scr to work. But not the timeout.
|
Top
|
|
|
|
#126675 - 2004-09-14 02:02 PM
Re: Screensaver trouble
|
Gos
Fresh Scripter
Registered: 2004-05-28
Posts: 23
|
PROBLEM SOLVED PROBLEM SOLVED PROBLEM SOLVED
Thank you for your help. I loged out and loged in again and it worked. =) Thank you for your help. ,)
|
Top
|
|
|
|
#126678 - 2004-09-15 10:21 AM
Re: Screensaver trouble
|
Anonymous
Anonymous
Unregistered
|
So if I understand this correct, if I put the UserUpdateParamter-code behind my code there, the user wont have to logoff and logon again for the screensaver to become "active"?
Cool. Thanks. =)
|
Top
|
|
|
|
#126680 - 2004-09-15 10:42 AM
Re: Screensaver trouble
|
Gos
Fresh Scripter
Registered: 2004-05-28
Posts: 23
|
Quote:
So if I understand this correct, if I put the UserUpdateParamter-code behind my code there, the user wont have to logoff and logon again for the screensaver to become "active"?
Cool. Thanks. =)
That was me. However, I can not seem to get it to work. I am trying to get the example in that link to work. (With a different picture though)
Does it matter what key you push to continue?
Calling the function means just writing this, right?
UpdateUserParameters()
Edited by Gos (2004-09-15 10:43 AM)
|
Top
|
|
|
|
#126682 - 2004-09-15 12:04 PM
Re: Screensaver trouble
|
Gos
Fresh Scripter
Registered: 2004-05-28
Posts: 23
|
So... Why does not this work?
Code:
writevalue('HKCU\Control Panel\Desktop\','Wallpaper','c:\pic.jpg','REG_SZ')
$nul = UpdateUserParameters()
function UpdateUserParameters()
SHELL 'RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters'
exit @error
endfunction
$nul
It has perhaps something to do with the UDF-calling thingy, but I only got a bunch of errors. =P Remember I am a newbeginner in kiX'ing. =D
|
Top
|
|
|
|
#126685 - 2004-09-15 12:19 PM
Re: Screensaver trouble
|
Gos
Fresh Scripter
Registered: 2004-05-28
Posts: 23
|
There is no errors. But I if I check out the Display page, it shows that the background image has been changed and everything, but the background-background is black...
Strangly enough. Does it have to be *.bmp? Do I lack something in my code?
|
Top
|
|
|
|
#126687 - 2004-09-15 01:03 PM
Re: Screensaver trouble
|
Gos
Fresh Scripter
Registered: 2004-05-28
Posts: 23
|
Gentlemen... You are hereby entitled to calling me a "n00b". Why?
Because, this was said: "does that bmp really exist ?" and I thought.... Does it really have to be a bmp. Guess what? It worked when I used a bmp-picture instead.
Thank you again for helping me out. =) I really appreciate it.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 515 anonymous users online.
|
|
|