Einzelnen Beitrag anzeigen

user

Registriert seit: 13. Jul 2010
25 Beiträge
 
Delphi 2 Desktop
 
#3

AW: Anti End Task, not WM_Close?

  Alt 1. Jan 2011, 20:07
Call getsystemmetrics with SM_SHUTTINGDOWN and set CanClose to true in such a case.

BTW: Your app is not user friendly. However, in the end the user will always be able to close your application. It just takes a little more effort.
I'll try "getsystemmetrics with SM_SHUTTINGDOWN". Yeah I just want to prevent end task. I know there are many ways to kill an app. No I'm not making virus!


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?

Geändert von user ( 1. Jan 2011 um 20:25 Uhr)
  Mit Zitat antworten Zitat