How to? enable or disable screen saver password

May 20, 2008
3,515
4
Elkridge, MD, USA
@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.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
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".
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,460
88
Albuquerque, NM
prospero.unm.edu
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.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
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.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
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
Thread starter Title Forum Replies Date
Joe Caverly ENABLE and LOOKUPERRORS Support 1
P How to enable \ with tab completion Support 4
A How to? How to enable UTF-8 output in tcmd.ini Support 9
J How do I enable an email feed of the new fora? Support 1
mscheuner RSS-enable these forums, please! Support 2
vefatica Disable extended directory searches (completely)? Support 8
WadeHatler Any way to disable ALL the global hotkeys? Support 8
F How to? Disable TCC's internal response to Alt-F4 Support 8
T Disable audible beep on input and inkey Support 2
P Can't disable internal tar, at least in pipes Support 3
M Disable commands? Support 2
J How to? Disable unix-style paths interpretation of / Support 2
P Disable global hotkey Ctrl+Shift+T Support 19
jbarnes1967 Disable wildcard [ char in destination Support 10
rconn How to disable avatars Support 10
J Disable Automatic Directory Changes? Support 6
M No line wraps if last line of the screen buffer is reached Support 5
krischik Take Command opens with (almost) white screen and then hangs Support 3
O Why this screen? Support 10
M TCC screen text bright colors not as bright in 24 as 23 Support 5
vefatica Win10, alternative screen buffer, cursor doesn't blink Support 11
R Vertical scroll bar disappeared with SCREEN Support 6
T How to? Show the values of batch variables on the TCC screen Support 21
T How to? Off screen move? Support 3
G Odd problem - screen brightness Support 4
R Find in screen buffer - find next behavior Support 0
samintz How to? Screen capture with color Support 13
fishman@panix.com Can I start TCC in full screen mode? Support 9
G Linux curses (full screen) crashes TC Support 1
L w10 - half screen Support 2
I TC "Registering" but NOT Registering, Now Hung on TCMD Option Screen Support 2
Jay Sage Ctrl-C Not Working Reliably to Copy Screen Content Support 4
L Full Screen in Office 2013 theme chars missing Support 8
J Screen Capture (Console Mode) Support 5
H V15 installer difficult to use with JAWS screen reader Support 0
knudvaneeden cls in TakeCommand screen does not clear full screen Support 26
G WAD Pipe clears screen Support 2
J Color command and Screen Buffer. Support 2
H VIEW not "screen reader friendly: Support 7
fishman@panix.com Is there a way to get the HELP screen to open maximized? Support 4
O Pausing screen? Support 2
J Utility to Save/Restore current screen Support 16
Joe Caverly Clearing a section of the screen works in CMD, not in TC Support 2
Roedy Screen background colours Support 1
A TakeCommand screen width Support 1
I Environment variable in OPTION screen? Support 2
G Cls Does not appear to clear screen Support 8
D TCC - Full Screen/History window conflict - workaround? Support 4

Similar threads