How to disable Windows screen saver if it works using C #?

Ok, so I found code to check if the splash screen works, and kill it if I want. It doesn't seem to work on a Windows 7 PC. Does anyone know how to change this code or provide a new code for this?

My application is designed to run in the background until a specific event occurs, and then create and show a full-screen notification. This must be displayed even if a screen saver is stored.

Thanks in advance for your help.

+4
source share
3 answers

The easiest way is to fake the mouse move event with x = y = 0 by calling SendInput ().

+2
source

The following question may provide some insight:

How to enable screensaver (windows 7) using code (in cmd)?

However, what if the machine is locked? I do not think that you can display any application on top of the lock screen if it is not actually a screensaver (and even then it may not be possible).

+2
source

Assuming you don't have a password-protected splash screen: (from http://support.microsoft.com/kb/140723 )

PostMessage (GetActiveWindow(), WM_CLOSE, 0, 0L); 
+1
source

Source: https://habr.com/ru/post/1345743/


All Articles