Hi,
I want to prevent Windows XP from powering down as long as my Delphi app is running, and I tried the following:
procedure TForm1.FormCreate(Sender: TObject);
begin
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, nil, 0);
SystemParametersInfo(SPI_SETPOWEROFFACTIVE, 0, nil, 0);
SystemParametersInfo(SPI_SETLOWPOWERACTIVE, 0, nil, 0);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 1, nil, 0);
SystemParametersInfo(SPI_SETPOWEROFFACTIVE, 1, nil, 0);
SystemParametersInfo(SPI_SETLOWPOWERACTIVE, 1, nil, 0);
end;
but that doesn't seem to work. Other suggestions anyone?
TIA
Steven