Forum: Object-Pascal / Delphi-Language
Delphi
by DeddyH,
18. Okt 2013
I have found an interesting thread concerning the problem (except the tray icon): https://forums.embarcadero.com/thread.jspa?threadID=66986
Forum: Object-Pascal / Delphi-Language
Delphi
by DeddyH,
18. Okt 2013
Just a few thoughts: you know the ProcessHandle, which is needed for TerminateProcess. To retrieve the corresponding ProcessID you could call OpenProcess. Once you have this ID you could call EnumWindows and within its callback compare your ProcessID to the one of the current window using GetWindowThreadProcessId. If they match, send your Close-Command to that window. I think this should work,...