Is there any Windows application out there that will determine what process is preventing the screen saver from becoming active?
-
1Welcome to SuperUser. What version of windows are you using?Raystafarian– Raystafarian2012-02-08 20:05:13 +00:00Commented Feb 8, 2012 at 20:05
-
1The screensaver not activating could be caused by three different issues: (1) a program is specifically preventing the screensaver, (2) the mouse is preventing the screensaver because it is “moving” due to a hair on the optical sensor (or dirty ball) or being perched on the edge of a desk/pad/etc, or (3) a program or mouse is preventing the power-management options from activating, and thus indirectly stopping the screensaver. I don’t know of any programs that can list other software that is blocking screensavers/power-settings on purpose, but the mouse problems are easy to check.Synetech– Synetech2012-02-08 20:14:12 +00:00Commented Feb 8, 2012 at 20:14
-
1^ agree, have not seen a program that seeks out which program. Programs or processes, can often be stopped. When having the same problem, I set the screen saver (or other power options) to very very short, then test by starting and stopping things. Also some "devices" in the device manager, have "power management" tabs, those devices will give control of "allows this device to wake the comptuter" so when you run out of program options , you can move on to device options.Psycogeek– Psycogeek2012-02-08 21:16:18 +00:00Commented Feb 8, 2012 at 21:16
-
2infosecblog.org/2011/03/windows-7-screensaver-timeout Group policy, Flash holding it out, and Vmware & Powercfg overrides.Psycogeek– Psycogeek2012-02-08 21:32:16 +00:00Commented Feb 8, 2012 at 21:32
-
2doing a screen saver Preview , or using a program like the many small programs that kick it in directly pretentiousname.com/miscsoft/index.html#ScreenSave (screensave) can assist in discovery of what kicks it back off, or keeps it from occuring. that can save time.Psycogeek– Psycogeek2012-02-08 21:49:27 +00:00Commented Feb 8, 2012 at 21:49
8 Answers
Run powercfg /requests from an Admin Command Prompt. For example, mine printed:
DISPLAY:
[PROCESS] \Device\HarddiskVolume8\Games\Origin\Origin.exe
Playing video
SYSTEM:
[DRIVER] Realtek High Definition Audio (HDAUDIO\FUNC_01&VEN_10EC&DEV_0900&SUBSYS_10438560&REV_1000\4&9793a48&0&0001)
An audio stream is currently in use.
AWAYMODE:
None.
Which indicates that Origin was playing a video and this was preventing the screensaver from running.
-
To me, this answer hits the bullseye. Coupling with
Process Explorerfrom Sysinternals (docs.microsoft.com/en-us/sysinternals/downloads/…), I was able to kill the process that preventing my display from going to screen saver & screen off mode.tdwong.star– tdwong.star2021-11-01 16:07:14 +00:00Commented Nov 1, 2021 at 16:07 -
3Mine prints all "none", and still the screensaver does not activate.Martin Argerami– Martin Argerami2021-12-09 05:07:57 +00:00Commented Dec 9, 2021 at 5:07
powercfg is built into windows and lets you control and view lots of power management settings.
powercfg -energy -trace
This will create a very detailed power management event log, energy-trace.etl. Open it with Event Viewer and filter log by Event Source: Kernel-Power, Include event ID: 62.
This should give you events that look like:
The application or service \Device\HarddiskVolume1\games\Steam\Steam.exe has overridden user power management settings with a code of 0x3.
The code may be different depending whether screensaver, monitor sleep, or another state transition was prevented.
-
I get "The power efficiency diagnostic library (energy.dll) could not be loaded". Why might that be? (the Power service is started)Sanjay Manohar– Sanjay Manohar2013-04-17 00:54:12 +00:00Commented Apr 17, 2013 at 0:54
-
2Incase this is driving anyone else nuts: To open energytrace.etl open
Event Viewer| ClickEvent Viewer (Local)in tree |Action|Open Saved Log| openC:\Windows\System32\energytrace.etlTell it to convert to the new log format. Works on windows 10.candied_orange– candied_orange2016-03-19 10:27:49 +00:00Commented Mar 19, 2016 at 10:27 -
7In Windows 10 just run powercfg /energy and a web page will be created instead.Professor of programming– Professor of programming2018-02-17 22:30:18 +00:00Commented Feb 17, 2018 at 22:30
Sometimes just changing the time on the screensaver (not the type) to something else, say from 10 min down to 1 and then back to what you had it before will allow the screen saver to function normally.
Thanks to W1N9Zr0 for pointing me in the right direction!
In my case, it was an XP Pro (SP3) machine so the "energy" switch was not available, However, the "devicequery" switch indicated that it was either the mouse or the keyboard. Once I switched from the PS/2 keyboard I was using to a USB keyboard, the screensaver (and other power options) kicked in per the settings.
NOTE: When screensaver was set to 1 minute, it would sometimes kick in so I knew it was working. Anything above 1 minute and the screensaver would never kick in.
-
Disconnecting my Generic USB gamepad fixed the issue!Shayan– Shayan2024-02-15 13:03:26 +00:00Commented Feb 15, 2024 at 13:03
I find the culprit is typically a media player. You'd think it'd only be when playing video, but I have had some music players hold off the screen saver. For example I had Amazon Music and Groove open and paused today, and just found my screen still unlocked after an hour.
I'm not sure which is to blame, but I suspect them over the IDE and browser I was running, both of which do let the screen lock.
For a Mac you can try opening the Activity Monitor going to the Energy Tab and ordering fields by Preventing Sleep. You should be able to easily identify the guilty application ✅
-
I cannot find anything like that, please elaborateSlav– Slav2021-07-22 16:28:18 +00:00Commented Jul 22, 2021 at 16:28
I have struggled with this for years, there always seems to be something that wants to prevent your screen going blank, and give your screen burn in. This will iterate through all the items preventing your screen from going blank, and disable them, then force quit anydesk instances as active sessions in anydesk prevent a monitor turning off. Then it executes a command to shut the monitor off via powershell.
@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
powershell.exe -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
exit /b
)
setlocal EnableDelayedExpansion
echo Finding all active display requests...
set "proclist="
set "inDisplaySection=false"
for /f "delims=" %%a in ('powercfg /requests') do (
set "line=%%a"
rem Section headers in powercfg output don't have leading spaces and end with a colon.
if /i "!line!" == "DISPLAY:" (
set "inDisplaySection=true"
) else if "!line:~-1!" == ":" (
set "inDisplaySection=false"
)
if "!inDisplaySection!" == "true" (
rem Check if the line (which might be indented) contains [PROCESS]
echo !line! | findstr "[PROCESS]" >nul
if !errorlevel! == 0 (
rem Split the line. %%b will be "[PROCESS]", %%c will be the path.
for /f "tokens=1,*" %%b in ("!line!") do (
set "procpath=%%c"
rem This for loop is a trick to get filename.ext from a full path.
for %%d in (!procpath!) do (
set "procname=%%~nxd"
set "proclist=!proclist! "!procname!""
)
)
)
)
)
if defined proclist (
echo Overriding display requests for the following processes:!proclist!
for %%p in (!proclist!) do (
echo Overriding display request for %%~p
powercfg -requestsoverride PROCESS "%%~p" display system
)
) else (
echo No active display requests found to override.
)
echo Done overriding.
endlocal
setlocal enabledelayedexpansion
echo.
echo Restarting Anydesk processes to clear potential display locks...
set "anydesk_paths="
for /f "skip=1 delims=" %%a in ('wmic process where "name like 'anydesk%%' and ExecutablePath is not null" get ExecutablePath') do (
set "path=%%a"
for /f "tokens=*" %%b in ("!path!") do set "path=%%b"
if defined path (
rem Check if the path is already in the list to avoid duplicates.
echo "!anydesk_paths!" | findstr /C:"\"!path!\"" >nul
if !errorlevel! neq 0 (
set "anydesk_paths=!anydesk_paths! "!path!""
)
)
)
if defined anydesk_paths (
echo Found running Anydesk processes. Terminating them...
taskkill /f /im anydesk*.exe /t >nul 2>&1
echo Waiting for processes to close...
timeout /t 1 /nobreak >nul
echo Relaunching Anydesk applications...
for %%p in (!anydesk_paths!) do (
if exist %%~p (
echo - Starting %%~p
start "" "%%~p"
) else (
echo - Path not found, cannot restart: %%~p
)
)
) else (
echo No running Anydesk processes found.
)
endlocal
start "" cmd /c "powershell.exe -Command "(Add-Type '[DllImport(\"user32.dll\")]public static extern int SendMessage(int hWnd,int hMsg,int wParam,int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)""
I don't know of any program that does this, but the way to find out is via the GetThreadExecutionState() function which will hold the value ES_DISPLAY_REQUIRED if the thread is currently blocking the screensaver from being activated.
If you apply this function to all of the threads in the system and then call GetProcessIdOfThread on the thread that you find, you'll have found the process that is blocking the screensaver.
-
1There is no "GetThreadExecutionState()".James– James2012-04-17 08:41:45 +00:00Commented Apr 17, 2012 at 8:41