How to pause / resume any external process under Windows?

后端 未结 6 1433
粉色の甜心
粉色の甜心 2020-12-16 19:56

I am looking for different ways to pause and resume programmatically a particular process via its process ID under Windows XP.

Process suspend/resume tool does it wi

6条回答
  •  轮回少年
    2020-12-16 20:16

    So, after I found about UniversalPauseButton, Googling for this ("windows SIGSTOP"), getting this question as the first search result (thanks Ilia K. your comment did its job), and reading the answers, I went back to checkout the code.

    Apparently, it uses undocumented NT kernel and Win32 APIs _NtSuspendProcess, _NtResumeProcess and _HungWindowFromGhostWindow.

    PsSuspend, the utility you mentioned and linked to probably uses these APIs, I couldn't verify this, the source code isn't supplied, only executables and a EULA, you can probably figure that out by disassembling the binary but it's against the EULA.

    so, to answer your specific question, checkout UniversalPauseButton's main.cpp, basically you call _NtSuspendProcess(ProcessHandle) and _NtResumeProcess(ProcessHandle), ProcessHandle being the handle of the process you want to pause or resume.

提交回复
热议问题