TProcess doesn't respect the poNoConsole option
Original Reporter info from Mantis: yoni
-
Reporter name: Yoni Stoffman
Original Reporter info from Mantis: yoni
- Reporter name: Yoni Stoffman
Description:
When creating a process with poNoConsole the console screen is still shown.
Steps to reproduce:
try
AProcess := TProcess.Create(nil);
AProcess.Executable := 'A console app of you liking';
APRocess.ShowWindow:= TShowWindowOptions.swoHIDE;
AProcess.Options := AProcess.Options + [poWaitOnExit, poNoConsole,poUsePipes];
AProcess.Execute;
finally
AProcess.Free;
end;
Additional information:
It seems that the problem is from a wrong option mapping. The code on process.inc file:
if poNoConsole in FProcessOptions then
Result:=Result or Detached_Process;
While the documentation on MSDN at https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx
States there that there is an option called CREATE_NO_WINDOW which differ from DETACHED_PROCESS
Mantis conversion info:
- Mantis ID: 32055
- OS: 10
- OS Build: Creator Update
- Platform: Windows
- Version: 1.8RC2
- Fixed in version: 3.1.1
- Fixed in revision: 36678 (#606d6d73)
- Monitored by: » zaher (Zaher Dirkey), » Vincent (Vincent Snijders)
- Target version: 3.2.0