Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? enable or disable screen saver password

May
3,515
5
@winsystem allows turning screen saver on or off and its timeout from within TCC. Two other features I would also like to control from within TCC:
1/ whether or not password is required when screen saver is active;
2/ when password is required, delay from screen saver becoming active during which any keyboard or pointer action restores screen without requiring password.

The second of these is controllable via the TweakUI application from Sysinternals, but not within TCC.
 
My SCRNSAVER command (in UIStuff) supports the first one. Not the second one, the grace period, but it wouldn't be difficult to add. Or you can use @REGSET.
 
Thanks! I already use the command to set timeouts (either 15s when I am not using the system, or 15min when I do but may be distracted), and SCREENRES to change screen resolution (which I need due to aging eyes).

What registry entry controls the grace period? It is simple enough to do it without the need to change UIstuff, though it would make your SCRNSAVER command more comprehensive. BTW, your HELP does not indicate that each of its parameters is optional, required only to force a state or value (I originally wrote "make a change", but realized the value may already be what is desired, not a change).

Is there a way to activate a command (e.g., to change screen resolution) when the OS activates the screen saver? That would be like a "screensavermonitor".
 
What registry entry controls the grace period?

According to this page, it's HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\ScreenSaverGracePeriod , a string value containing the number of seconds. (They also say you should reboot after changing it. Perhaps @REGSETENV would do? Or just restarting Explorer? I don't know; I've never felt a need to change it.)

Is there a way to activate a command (e.g., to change screen resolution) when the OS activates the screen saver? That would be like a "screensavermonitor".

I can't think of anything better than running a hidden session and checking _SSVRUP every, say, ten seconds.
 
Is there a way to activate a command (e.g., to change screen resolution) when the OS activates the screen saver? That would be like a "screensavermonitor".
You can also test @WINSYSTEM[114] (SPI_GETSCREENSAVERRUNNING). That parameter, 114, is not documented in the help and since it works, I suppose it should be documented. The documented parameter, 16 (SPI_GETSCREENSAVEACTIVE), only tells is a screensaver is configured, not whether it's actually running.
I can (vaguely) imagine a plugin, (ONSSAVE [on_command [off_command]], perhaps). It could use a Win Event Hook (SetWinEventHook()) looking for EVENT_SYSTEM_FOREGROUND and, upon getting it, use SystemParametersInfo(SPI_GETSCREENSAVERRUNNING) to determine if the screensaver has started or stopped since the last foreground window change. How well on_command and off_command might work would depend on what they were and what TCC happened to be doing at the moment.
 
Is there a way to activate a command (e.g., to change screen resolution) when the OS activates the screen saver? That would be like a "screensavermonitor".

Steve (others), perhaps you'd try SSMON (see below, absolutely no guarantees). As I said before, it's no doubt limited in what you can ask TCC to do. TCC executes your commands using TakeCmd.DLL's Command(). I don't even know if Command() in re-entrant but in simple tests, SSMON did not mess up running batch files. And, no doubt, there are plenty of things in TCC that are not re-entrant so keep it simple.
SSMON uses "C" style parsing (argc/argv) so for embedded quotes use \". And, of course, if you want variables de-referenced at runtime, use %%varname.
This much works. I'd like to hear reports of other successes (or failures).
Code:
v:\> which ssmon
ssmon is a plugin command (SSMONITOR)
 
v:\> help ssmon
SSMON [OFF | "on_command" ["off_command"]]
 
v:\> ssmon
SSMON is OFF
 
v:\> ssmon "beep 440 1" "beep 880 1"
 
v:\> ssmon
SSMON is ON
On_command:  beep 440 1
Off_Command: beep 880 1
 
v:\>
 

Similar threads

Back
Top