procedure TForm1.Button1Click(Sender: TObject);
var
handle:integer;
aBool:Boolean;
begin
SystemParametersInfo(SPI_GETSCREENSAVEACTIVE,0,@aBool,0);
if aBool then
begin
handle:=Findwindow('shell_traywnd',nil);
SendMessage(self.handle,$0112,61760,0);//启动屏幕保护程序
exit;
end;
Messagebox(0,'你没有设定屏幕保护','ScrStart',MB_ICONQUESTION or MB_OK);
end;