How to Prevent Screen Saver and Power Monitor on Windows? lazarus / 34-Windows ---------------------------------------------------------------------- carlosnatal · 2025-02-25 11:38 For a program presentation i need a rotiine that block power monitor and screen saver program. Do can you help me? ---------------------------------------------------------------------- Zvoni · 2025-02-25 11:54 Quote from: carlosnatal on February 25, 2025, 12:38:41 pmFor a program presentation i need a rotiine that block power monitor and screen saver program. Do can you help me? For your program presentation, switch it off in Windows Settings...... ---------------------------------------------------------------------- Fibonacci · 2025-02-25 11:56 Try this: https://learn.microsoft.com/en- us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SetThreadExecutionState(ES_CONTINUOUS or ES_SYSTEM_REQUIRED or ES_DISPLAY_REQUIRED); ---------------------------------------------------------------------- Zvoni · 2025-02-25 12:12 Quote from: Fibonacci on February 25, 2025, 12:56:21 pmTry this: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf- winbase-setthreadexecutionstate Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SetThreadExecutionState(ES_CONTINUOUS or ES_SYSTEM_REQUIRED or ES_DISPLAY_REQUIRED);From the link above: QuoteThis function does not stop the screen saver from executing. ---------------------------------------------------------------------- Remy Lebeau · 2025-02-25 20:56 Programmatically prevent Windows screensaver from starting ---------------------------------------------------------------------- RayoGlauco · 2025-02-25 22:26 I use this procedure, which I call periodically with a TTimer: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure AvoidIdle;// Creates a null mouse move // uses JwaWinUser var  Input: TInput;begin  Input.mi.dx := 0; // remove a warning  FillChar(Input, SizeOf(Input), 0);  Input.mi.mouseData := 0;  Input.mi.dx := 0;  Input.mi.dy := 0;  Input.type_ := INPUT_MOUSE;  Input.mi.dwFlags := MOUSEEVENTF_MOVE;  SendInput(1, @Input, SizeOf(Input));end;