1. Home
  2. Computing & Technology
  3. Delphi Programming

Activate/Deactivate the Screen Saver

By Zarko Gajic, About.com

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;
~~~~~~~~~~~~~~~~~~~~~~~~~
Here some more screen saver development articles.

Delphi tips navigator:
» Implementing Application.Restart
« Get Cursor Image (draw it on a Canvas)

Zarko Gajic
Guide since 1998

Zarko Gajic
Delphi Programming Guide

Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2001 Delphi Tips
  7. Activate/Deactivate the Screen Saver

©2009 About.com, a part of The New York Times Company.

All rights reserved.