A:
unit Nosaver;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure AppMessage(var msg: TMsg; var handled:
boolean);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.AppMessage(var msg: TMsg; var handled: boolean);
begin
if (msg.message = wm_SysCommand) and (msg.wParam = sc_ScreenSave)
then
handled := true; {TRUE = Disable the screensaver.}
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
application.OnMessage := AppMessage;
end;
end.