W
weiliu
Unregistered / Unconfirmed
GUEST, unregistred user!
运行的时候发现当屏幕保护起作用时,能听到那嘟一声而且提示已有显示,而屏幕保护却依然如故地在运行,并没有被禁止,是怎么回事?不是说那个HANDLE变成TRUE就会禁止屏保运行吗?解决问题的人,本人除了此问题的分数外,另奉送http://www.delphibbs.com/delphibbs/dispq.asp?lid=3630298
中的200分。
程序如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure AppMessage(var msg:TMsg;var Handled:boolean);
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
begin
Handled:=True;
MessageBeep(0);
MessageDlg('Screen-saver is Disabled!',mtWarning,[mbOk],0);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
// set your applications message handler to your new one
Application.OnMessage := AppMessage;
end;
end.
中的200分。
程序如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure AppMessage(var msg:TMsg;var Handled:boolean);
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
begin
Handled:=True;
MessageBeep(0);
MessageDlg('Screen-saver is Disabled!',mtWarning,[mbOk],0);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
// set your applications message handler to your new one
Application.OnMessage := AppMessage;
end;
end.