AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Anti End Task, not WM_Close?

Ein Thema von user · begonnen am 1. Jan 2011 · letzter Beitrag vom 3. Jan 2011
Antwort Antwort
Benutzerbild von rollstuhlfahrer
rollstuhlfahrer

Registriert seit: 1. Aug 2007
Ort: Ludwigshafen am Rhein
1.529 Beiträge
 
Delphi 7 Professional
 
#1

AW: Anti End Task, not WM_Close?

  Alt 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!
  Mit Zitat antworten Zitat
user

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

AW: Anti End Task, not WM_Close?

  Alt 1. Jan 2011, 21:43

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
Still not working. I also change the value of SM_SHUTTINGDOWN to 2000 (referenced from MSDN). I am using 7 32 bit.
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#3

AW: Anti End Task, not WM_Close?

  Alt 1. Jan 2011, 21:43
And what's the use of it? If I want to end your application I just will call ProcessTerminate and that's it. Even a normal user cab do this. He just has to switch to the process panel of the taskmanager. Users ain't silly.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
user

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

AW: Anti End Task, not WM_Close?

  Alt 1. Jan 2011, 21:45
And what's the use of it? If I want to end your application I just will call ProcessTerminate and that's it. Even a normal user cab do this. He just has to switch to the process panel of the taskmanager. Users ain't silly.
I already hook TerminateProcess.
  Mit Zitat antworten Zitat
Benutzerbild von rollstuhlfahrer
rollstuhlfahrer

Registriert seit: 1. Aug 2007
Ort: Ludwigshafen am Rhein
1.529 Beiträge
 
Delphi 7 Professional
 
#5

AW: Anti End Task, not WM_Close?

  Alt 1. Jan 2011, 21:49
Why hook ProcessTerminate? - You just need to hook OpenProcess.
But why do you do so? - Just create a process with Admin-Account and don't let the user get Admin-Rights and your process acts like it should, cause a Non-Admin can't terminate Processes from an Admin-Account. Or create a service.

Bernhard
Bernhard
Iliacos intra muros peccatur et extra!
  Mit Zitat antworten Zitat
user

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

AW: Anti End Task, not WM_Close?

  Alt 1. Jan 2011, 22:03
Why hook ProcessTerminate? - You just need to hook OpenProcess.
But why do you do so? - Just create a process with Admin-Account and don't let the user get Admin-Rights and your process acts like it should, cause a Non-Admin can't terminate Processes from an Admin-Account. Or create a service.

Bernhard
Yes, hooking XxOpenProcess maybe better than hooking XxProcessTerminate. I'll implement that later. No, user can use my app in Admin-Account. My problem is user can kill my app from end task.
  Mit Zitat antworten Zitat
Benutzerbild von rollstuhlfahrer
rollstuhlfahrer

Registriert seit: 1. Aug 2007
Ort: Ludwigshafen am Rhein
1.529 Beiträge
 
Delphi 7 Professional
 
#7

AW: Anti End Task, not WM_Close?

  Alt 1. Jan 2011, 22:08
Why do you need a not-closable Application?

Bernhard
Bernhard
Iliacos intra muros peccatur et extra!
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#8

AW: Anti End Task, not WM_Close?

  Alt 1. Jan 2011, 22:12
If I want to kill your application and you will not allow ist, I just pull the plug after the administrator has removed your application from auto run. Or can you prevent the user from pulling the plug with your application?
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:01 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz