Autor Beitrag
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Sa 05.08.06 16:51 
Hi,
Ich habe mit Delphi ein Programm geschrieben, dass auch als Prozess laufen kann, also ohne sichtbares Fenster. Wenn ich aber den Computer herunterfahren will, ohne dass ich mein Prog davor selbst beende, dann weigert sich der PC auszuschalten.

Ich geh hald auf Start->ausschalten->ausschalten: die anderen Prozesse wie antivir und firewall und so werden beendet (das seh ich im Tray), aber eben nicht mein Prozess. Mit dem Taskmanager wird aber mein Prozess ohne Probleme beendet.

Weiß jemand woran das liegt?
Wäre euch sehr dankbar.
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 05.08.06 17:07 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
  private
    procedure WMQueryEndSession(var M: TWMQueryEndSession); message WM_QUERYENDSESSION;
  public
  end;

var
  PGMainForm: TPGMainForm;

implementation

{$R *.dfm}

procedure TPGMainForm.WMQueryEndSession(var M: TWMQueryEndSession);
begin
inherited;
  // Falls Windows beendet wird, dann folgendes ausführen
  M.Result := 1; // Bestätigt das Herunterfahren (WICHTIG!)
  Close;
end;

Quelle: www.delphi-forum.de/viewtopic.php?t=34210 (ganz unten)

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Jakob Schöttl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Sa 05.08.06 17:47 
Vielen Danke Jakob.
Da wäre ich ja nie draufgekommen!

Und das machen alle Prozesse so, also auch AntiVir und ZoneAlarm zum Beispiel?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 05.08.06 18:40 
Natürlich.

Alle außer dem BDS 2006 :evil:

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.