Autor Beitrag
Der Michel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 38



BeitragVerfasst: Di 11.03.03 12:37 
Hallo,

habe gesehen daß es in der User32.dll eine Funktion namens 'IsHungAppWindow' gibt, mit der man feststellen kann ob ein Programm (genauer gesagt: ein Fenster) abgestürzt ist. Die Funktion liefert dann TRUE zurück, wenn seit 5 Sekunden keine Messages mehr abgeholt wurden.
Wenn dies nun der Fall ist, wie kann ich das abgestürzte Programm dann beenden?

Gruß,

Der Michel
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Di 11.03.03 12:57 
mit TerminateProcess()
Der Michel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 38



BeitragVerfasst: Di 11.03.03 13:33 
Klingt einleuchtend. :D
Kann ich, da ich ja den Fenster-Handle hab, damit auch irgendwie den Process-Handle ermitteln, oder muß ich Process32First(...) und so verwenden?

Gruß,
Der Michel
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Di 11.03.03 14:21 
Du benötigst ein Process-Handle mit PROCESS_TERMINATE Zugriff (bekommst du mit OpenProcess). Die ProcessID für den Prozess zu dem das Fenster gehört bekommst du mit GetWindowThreadProcessID. Um jedoch ein gültiges Process-Handle für ein abgestürztes Service zu bekommen brauchst du noch das Debug-Privilege aktiviert.

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Der Michel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 38



BeitragVerfasst: Di 11.03.03 14:52 
Hat funktioniert. :D
Besten Dank.
Gruß,

Der Michel