In C I've used the system()
function before in a console application and if I start another process using system()
it inherits the console window of the process that called it.
In Delphi system()
doesn't exist so I'm using ShellExecute()
to create a new process, but the new process comes up in a new console window. Is there some way that I can make it inherit the handle of the window that's calling it?
I've used
function GetConsoleWindow(): HWND; stdcall; external 'kernel32.dll';
to get the console window and passed it in the HWND
part of ShellExecute()
, but that didn't work.