Suspending and Resuming a Process

The concept of suspending or resuming a process doesn’t exist for Windows because processes are never scheduled CPU time. However, I have been asked numerous times how to suspend all the threads in a process. In the special case of a debugger handling a debug event returned by WaitForDebugEvent, Windows freezes all the threads in the debuggee process until the debugger calls ContinueDebugEvent. You can also use the "Suspend Process" feature of Process Explorer from Sysinternals (http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/ProcessExplorer.mspx) to achieve the same effect: all the threads in the process are suspended.

Windows doesn’t offer any other way to suspend all threads in a process because ...

Get Windows® via C/C++, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.