in reply to Win32::Console Question: How to attache a process to console
Why are you using Win32::Spawn?
By default, processes inherit the same console as their parent.
The way to change that default is to create one (or more) consoles prior to creating the process, and supply their handle(s) in the hStdInput, hStdOutput, hStdError elements of the STARTUPINFO structure passed to the CreateProcess().
Alternatively, you could just obtain the console handles associated with the current process, before starting the child process, since it will inherit the console of it's parent.
|
|---|