kuijer
May 7th, 1999, 09:06 AM
Hi,
I'm building a command-line program to kill a window in winNT. Usage should be something like this : 'kill "test.txt - Notepad"'.
This what i have:
First I look for a HWND using EnumDesktopWindows and/or FindWindow,
then I call the method GetWindowThreadProcessId, which returns a PID. I use this PID with OpenProcess to get an HANDLE to this process. At last i try to terminate this process by TerminateProcess, but does nothing but *CRASH*
What am I doing wrong, or, how should i do this otherwise?
Grthnx,
Paul Kuijer
I'm building a command-line program to kill a window in winNT. Usage should be something like this : 'kill "test.txt - Notepad"'.
This what i have:
First I look for a HWND using EnumDesktopWindows and/or FindWindow,
then I call the method GetWindowThreadProcessId, which returns a PID. I use this PID with OpenProcess to get an HANDLE to this process. At last i try to terminate this process by TerminateProcess, but does nothing but *CRASH*
What am I doing wrong, or, how should i do this otherwise?
Grthnx,
Paul Kuijer