//下面是我用的例子,
//在98下成功
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Timer1: TTimer;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
{
BOOL SystemParametersInfo(
UINT uiAction, // system parameter to query or set
UINT uiParam, // depends on action to be taken
PVOID pvParam, // depends on action to be taken
UINT fWinIni // user profile update flag
);
Windows NT 5.0 and later, Windows 98: Determines whether
a screen saver is currently running on the window station
of the calling process. The pvParam parameter must point to
a BOOL variable that receives TRUE if a screen saver is
currently running, or FALSE otherwise. Note that only the
interactive window station, "WinSta0", can have a screen saver
running.
}
procedure TForm1.Button1Click(Sender: TObject);
var
b:integer;
begin
b:=0;
SystemParametersInfo(SPI_GETSCREENSAVERRUNNING,0,@b,0);
memo1.lines.add(inttostr(b));
if b<>0 then
showmessage(inttostr(b));
end;
end.