seyed_farid
چهارشنبه 16 دی 1388, 19:24 عصر
من با دستورهاي زير ميتونم شات دان شدن ويندوز را تو XP بفهمم و با برنامم جلوي اونو بگيرم ولي تو ويندوز 2000 با زدن كليد پاور سيستم فوراً شات دان ميشه و با اين دستورا نميشه جلوشو گرفت.
كسي ميتونه منو راهنمائي كنه كه تو 2000 چطور جلوي شات دان شدن سيستم رو بگيرم؟
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMQueryEndSession
(var Msg : TWMQueryEndSession) ;
message WM_QueryEndSession;
Procedure WMEndSession
(var Msg : TWMEndSession) ;
message WM_ENDSESSION;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
procedure TForm1.WMQueryEndSession
(var Msg : TWMQueryEndSession) ;
begin
if MessageDlg('Close Windows ?',
mtConfirmation,
[mbYes,mbNo], 0) = mrNo then
Msg.Result := 0
else
Msg.Result := 1 ;
end;
procedure TForm1.WMEndSession
(var Msg : TWMEndSession) ;
begin
if Msg.EndSession = TRUE then
ShowMessage('Windows is shutting down ' + #10#13
+ 'at ' + FormatDateTime('c', Now)) ;
inherited;
end;
{$R *.dfm}
end.
كسي ميتونه منو راهنمائي كنه كه تو 2000 چطور جلوي شات دان شدن سيستم رو بگيرم؟
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMQueryEndSession
(var Msg : TWMQueryEndSession) ;
message WM_QueryEndSession;
Procedure WMEndSession
(var Msg : TWMEndSession) ;
message WM_ENDSESSION;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
procedure TForm1.WMQueryEndSession
(var Msg : TWMQueryEndSession) ;
begin
if MessageDlg('Close Windows ?',
mtConfirmation,
[mbYes,mbNo], 0) = mrNo then
Msg.Result := 0
else
Msg.Result := 1 ;
end;
procedure TForm1.WMEndSession
(var Msg : TWMEndSession) ;
begin
if Msg.EndSession = TRUE then
ShowMessage('Windows is shutting down ' + #10#13
+ 'at ' + FormatDateTime('c', Now)) ;
inherited;
end;
{$R *.dfm}
end.