16

I'm unfamiliar with how processes are killed in Windows. In Linux, a "warm" kill sends a signal (15) which the process can handle by instantiating a signal handler. A cold kill is signal (9) which the OS handles by killing the process forcefully.

How can I "kill" a process in Windows? How is it handled by OS and by the process? What actions does OS perform? Is there a cross-platform way of responding to a kill/close request?

kubanczyk
  • 14,252
IttayD
  • 1,157
  • 4
  • 12
  • 14

3 Answers3

15

"End Task" (and taskkill) appears to post a WM_CLOSE message to the program's windows. (The same is done when you click the × "Close" button.) If the program does not exit in some time, user gets prompted to end the program forcefully.

"Kill Process" and taskkill /f use TerminateProcess().

Arend
  • 105
grawity
  • 17,092
0

Sysinternals (now part of Microsoft) offers a utility called pskill which can be used from the command line to kill processes on the local system or on remote systems.

The usual way to kill processes in Windows in a GUI environment is to use the Task Manager.

-1

with cygwin you can use a cross platform kill!

tony roth
  • 3,952
  • 20
  • 14