Hallo, ich habe ein Problem: Mein Programm wird beim Shutdown nicht beendet, es kommt auch keine Fehlermeldung, aber Windows fährt nicht herunter. liegt es daran dass ich eine CloseQuerry function drinhabee und CanClose immer auf false setze?
Oder liegt es daran dass ich meine Anwendung versteckt habe?
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
| procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if f=true then begin canclose:=true; end else begin canclose:=false; form1.Button2Click(Sender); end; end; |
das f ist, wenn ich die Anwendung per Hotkey beende, damit er weiss, wann ichs zumachen darf.
Project:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
| program NVIDIA;
uses Forms, main in 'main.pas' ;
{$R *.res}
begin Application.Initialize; Application.ShowMainForm:=false; Application.CreateForm(TForm1, Form1); Application.Run; end. |
//edit: oder gibt es noch ne andere Möglichkeit, als den ShutdownBefehl abzufangen?
Hardware runs the world, software controls the hardware, code generates software - Have You already coded today?