How to Activate/Deactivate the Screen Saver

CK CK 3788 
Created at
Updated at  
863 0 0

Sometimes you want to deactivate the current screensaver when performing some very long process. You can use this function to activate or deactivate the screensaver. Pass True to activate it, or False to deactivate it.

 

function ActivateScreenSaver(Activate: boolean): boolean;
var IntActive: byte;
begin
	if Activate then
		IntActive := 1
	else
		IntActive := 0;

	Result := SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, IntActive, nil, 0) ;
end;
Tags Screen Saver Windows API chkdsk Facebook X
Comments 0
Similar posts
  1. How to capture the output from a DOS (command/console) Window
    965
  2. How to Change the Windows Start button bitmap
    428
  3. How to Close Another Application by Windows Caption
    390
  4. Controling sound volume from code
    424
  5. Copying Group of Files using Delphi with Standard Animation Dialog (SHFileOperation)
    413
  6. Detecting and preventing Windows shut down
    439
  7. Detecting Drive Types
    467
  8. Disable Mouse and Keyboard from Delphi Code
    794
  9. Display Standard Windows Properties dialog
    1,129
  10. Disable ALT+TAB, CTRL+ESC, CTRL+ALT+DEL
    1,826
  11. Get Windows Temp directory
    658
  12. How to Get Windows OS Version ?
    429
  13. How to Get Filenames from Clipboard ?
    1,502
  14. Get system info (free memory, etc)
    405
  15. Get dimensions of usable space on monitor (work area)
    489
  16. Get text from the control at pos x,y on screen
    468
  17. How to determine the output of a console application ?
    451
  18. How to install an INF file using Delphi ?
    463
  19. How to play sounds on the PC Speaker ?
    528
  20. How to remove your application from TaskBar
    658
  21. How to track a user's idle time
    589
  22. How to know whether the font is TrueTypeFont or not
    376
  23. List Devices (LPT, COM ports, ...)
    478
  24. How to restrict mouse movement
    408
  25. How to send char as message to another application
    544
  26. How to save text from Clipboard to a file
    569
  27. How to show window contents while dragging
    454
  28. How to use TTF Font Without Installing
    1,117
  29. Window flashing
    379
  30. JavaScript to disable Screen Saver or Power Saving Mode
    501
  1. How to encode subject content when sending mail with TIdMessage ?
    1,072
  2. Base64 Encoding/Decoding function for Delphi
    1,153
  3. How to send email by TIdSMTP VCL ?
    1,019
  4. How to return exit code such as exit() function in C/C++ ?
    663
  5. How to get parameter string ?
    1,239
  6. Save TBitmap image to Jpeg format image in Delphi
    712
  7. How to get screen resolution in case of using multiple monitors ?
    450
  8. How to turn off monitor ?
    429
  9. Find File at certain directory in Delphi
    437
  10. Sending email messages in .Net
    1,035
  11. Delphi for .Net Code Folding keyboard shortcuts
    527
  12. How to encrypt a string
    466
  13. Creating thumbnail images
    861
  14. Technology sharing related with software development. Specially content will be focused to programming language, and embedded systems.
    851
  15. How to speed up access to the RichTextBox Lines property
    830
  16. Retrieving all image links from an HTML document
    419
  17. List All Network Drives
    392
  18. How to set the "home page" for the Internet Explorer from Delphi code
    431
  19. How to get get IE favorites
    453
  20. Extracting the domain (host) name from an e-mail address
    487
  21. Download a file from the Internet with progress indicator
    553
  22. Are we connected to the Internet?
    422
  23. TImage.Bitmap fade out
    373
  24. TDesktopCanvas - draw on Windows Desktop
    558
  25. TColor to HTML color
    415
  26. Show *any* graphics as Glyph on a SpeedButton
    541
  27. Rotating Text
    448
  28. Paint a Form with a tiled bitmap image
    413
  29. Is Point in Polygon?
    368
  30. Implementing a lasso drawing technique
    384
Recently updated
  1. Why 100% SEO Guarantees Better User Engagement and How to Achieve It in Your Service
    42
  2. Why SPF and DKIM Are Essential for Linux Email Servers?
    36
  3. How do I create animated background for Google Meet?
    20,992
  4. MaxMind GeoLite2 vs. DB-IP Lite vs. ip-api.com: Choosing the Right Free IP Geolocation Solution
    251
  5. Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
    94
  6. How Rogue Web Scrapers Are Stealing My Content and Destroying My Server
    157
  7. Array of arguments passed to script in PHP
    90
  8. Invalid Auction Storms in Ad Tech
    98
  9. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    202
  10. The Two Clocks of Ad Server Architecture
    70
  11. Frequency Cap Architecture Overview
    515
  12. Collecting Proof-of-Play from 100,000 Screens
    146
  13. Vector Search in Relational Databases (RDBs): Trends & Usage Environments
    288
  14. What is RedisVL?
    109
  15. Designing a Skill Registry Architecture: Minimize Token Usage and Maximize AI Performance
    231
  16. TPU & GPU Cluster Management Tools
    245
  17. The Concept of Scaffolding in AI Agents
    234
  18. Beyond Static Pipelines: Architecting LLM Multi-Agent Systems for Autonomous Workflow Orchestration
    583
  19. AI-DLC vs. AI-SDLC: Model-Centric vs. System-Centric AI Development
    259
  20. Fine-Tuning Open-Weight LLMs: Training, Licensing, and Deploying Custom Models with Ollama
    339
  21. Inside the Next-Generation Streaming Architecture: Ultra-Low Latency, SGAI, and AI Codecs
    202
  22. Machine Learning: Training vs. Ranking
    222
  23. The Continuous Learning Machine: Designing a Loop That Actually Turns
    222
  24. The Next-Gen Low-Latency Standards: LL-HLS & MoQ
    195
  25. Designing a Data Curation System Around a Vector Database
    221
  26. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    256
  27. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    656
  28. Designing MLOps Architectures to Handle Seasonal Data Drift in EV Fleet Models
    196
  29. From 15 to 40+ FPS: Accelerating PyTorch Object Detection on Automotive ECUs
    219
  30. Understanding Data Lineage
    262