SendMessage 启动屏幕保护程序

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;




posted @ 2012-06-03 17:55  XE2011  阅读(141)  评论(0编辑  收藏  举报