Home » U++ Library support » U++ Library : Other (not classified elsewhere) » How to suspend/resume cmd.exe
How to suspend/resume cmd.exe [message #43585] |
Mon, 08 September 2014 21:38 |
|
koldo
Messages: 3404 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
I have a Windows program that runs .bat files using cmd.exe. It calls it using ShellExecuteEx function. This function returns a handle to the new process that can be used successfully to force the process termination with PostMessage WM_CLOSE.
So far so good.
The problem comes when I try to pause (suspend) the process. Windows has no SuspendProcess() or SIGSTOP. I have tried it in different ways:
- Sending a PostMessage WM_KEYDOWN VK_PAUSE
- Suspending all threads in the process with Thread32First(), Thread32Next() and SuspendThread (see here or here)
- Using undocumented function NtSuspendProcess (see here)
- Using Windows Sysinternals PsSuspend
- Changing the process priority with SetPriority to idle
No success. Processes inside .bat follow running at full throttle (in my test, an xcopy).
Do you know how to suspend cmd.exe, or other shortcut to handle this?
Best regards
IƱaki
|
|
|
Goto Forum:
Current Time: Fri Dec 13 23:13:19 CET 2024
Total time taken to generate the page: 0.02256 seconds
|