C++ Sending a simple signal in Windows

后端 未结 2 1292
臣服心动
臣服心动 2021-01-13 21:37

is there an equivalent to the function kill() on Windows?

int kill(pid_t pid, int sig);

If not, would it be possible to test if a process i

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-13 22:13

    No signals in Windows. If true killing is intended then use TerminateProcess(). You need a handle to the process, get that from OpenProcess(). You'll need to ask for the PROCESS_TERMINATE access right. CloseHandle() to close the handle.

提交回复
热议问题