U++ framework
Do not panic. Ask here before giving up.

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 is currently offline  koldo
Messages: 3460
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
 
Read Message
Previous Topic: How to disable the sort of the gridctrl with respect a given column
Next Topic: Issue in docking example application
Goto Forum:
  


Current Time: Tue Jun 16 12:30:24 GMT+2 2026

Total time taken to generate the page: 0.00375 seconds