public static bool GetScreenSaverRunning() { bool lpvParam = false; ScreenSaver.SystemParametersInfo(114, 0, ref lpvParam, 0); return(lpvParam); }
public static int GetScreenSaverTimeout() { int lpvParam = 0; ScreenSaver.SystemParametersInfo(14, 0, ref lpvParam, 0); return(lpvParam); }
public static bool GetScreenSaverActive() { bool lpvParam = false; ScreenSaver.SystemParametersInfo(16, 0, ref lpvParam, 0); return(lpvParam); }
private static bool KillScreenSaverFunc(IntPtr hWnd, IntPtr lParam) { if (ScreenSaver.IsWindowVisible(hWnd)) { ScreenSaver.PostMessage(hWnd, 16, 0, 0); } return(true); }
public static void KillScreenSaver() { IntPtr hDesktop = ScreenSaver.OpenDesktop("Screen-saver", 0, false, 129U); if (hDesktop != IntPtr.Zero) { ScreenSaver.EnumDesktopWindows(hDesktop, new ScreenSaver.EnumDesktopWindowsProc(ScreenSaver.KillScreenSaverFunc), IntPtr.Zero); ScreenSaver.CloseDesktop(hDesktop); } else { ScreenSaver.PostMessage(ScreenSaver.GetForegroundWindow(), 16, 0, 0); } }
public static void SetScreenSaverTimeout(int Value) { int lpvParam = 0; ScreenSaver.SystemParametersInfo(15, Value, ref lpvParam, 2); }
public static void SetScreenSaverActive(int Active) { int lpvParam = 0; ScreenSaver.SystemParametersInfo(17, Active, ref lpvParam, 2); }