Registriert seit: 1. Aug 2007
Ort: Ludwigshafen am Rhein
1.529 Beiträge
Delphi 7 Professional
|
AW: Anti End Task, not WM_Close?
1. Jan 2011, 21:34
edited :
Code:
SM_BASE = WM_USER + 1736 ;
SM_SHUTTINGDOWN = SM_BASE +2;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose:=false;
if (GetSystemMetrics (SM_SHUTTINGDOWN) <> 0) then
CanClose:=false;
end;
The code is right?
Can't be right. You don't set CanClose to true in any case. It has to be
Delphi-Quellcode:
if (GetSystemMetrics (SM_SHUTTINGDOWN) <> 0) then
CanClose := true;
Bernhard
Bernhard Iliacos intra muros peccatur et extra!
|