Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi anderes Programm "sanft" beenden (https://www.delphipraxis.net/35181-anderes-programm-sanft-beenden.html)

Luckie 3. Dez 2004 18:35

Re: anderes Programm "sanft" beenden
 
Muss nicht. Aber wenn es kein Fenster hat, dann hast du auch nichts, an das du WM_CLOSE schicken könntest und müsstest auf TerminateProcess zurückgreifen.

glkgereon 3. Dez 2004 18:42

Re: anderes Programm "sanft" beenden
 
hmpff :(

das war eben mein ziel den prozess net abzuschiessen, sondern ihn zu beenden...

weil wenn der abgeschossen wird, wird doch der speicher net freigegeben, oder?

Luckie 3. Dez 2004 18:51

Re: anderes Programm "sanft" beenden
 
Doch wird er.
Zitat:

Remarks
The TerminateProcess function is used to unconditionally cause a process to exit. Use it only in extreme circumstances. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if TerminateProcess is used rather than ExitProcess.

TerminateProcess initiates termination and returns immediately. This stops execution of all threads within the process and requests cancellation of all pending I/O. The terminated process cannot exit until all pending I/O has been completed or canceled.

Terminating a process causes the following:


All object handles opened by the process are closed.
All threads in the process terminate their execution. Each thread exits when all its pending I/O has been completed or canceled. The process exits after all its threads exit.
The state of the process object becomes signaled, satisfying any threads that had been waiting for the process to terminate. The process object is deleted when the last handle to the process is closed.
The states of all threads of the process become signaled, satisfying any threads that had been waiting for the threads to terminate.
The termination status of the process changes from STILL_ACTIVE to the exit value of the process.
Nur das ist zu beachten:
Zitat:

DLLs attached to the process are not notified that the process is terminating.
Das heißt: Läd dein Prozess eine DLL wird der Referenzcounter der DLL nicht zurück gesetzt. Hat noch ein weitere Prozess die DLL geladen und wird normal beendet und dein Prozess wird abgeschossen, wird die DLL nicht entladen, da der ReferenzCount noch bei 1 ist.

glkgereon 3. Dez 2004 18:54

Re: anderes Programm "sanft" beenden
 
und bei sachen wie quicktime wird das wohl der fall sein, das dlls im spiel sind....

dann halt net


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:31 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz