Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 3029
Registered: August 2008
Ultimate Member
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
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: Thu Nov 14 09:43:56 CET 2019

Total time taken to generate the page: 0.01641 seconds