pjf / ipc-system-simple

Perl module to make running system commands and capturing errors as simple as possible.

Home Page:http://search.cpan.org/perldoc?IPC::System::Simple

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make IPC::System::Simple respect Win32::SetChildShowWindow

mrudat opened this issue · comments

Hi, it would be nice if IPC::System::Simple could be enhanced to respect Win32::SetChildShowWindow.

Specifically, the following should have the same behaviour (excepting error handling):

#!wperl
use Win32;
Win32::SetChildShowWindow(0);
system("some command and args");
#!wperl
use Win32;
use IPC::System::Simple qw(system);
Win32::SetChildShowWindow(0);
system("some command and args");

At the moment, on Win32, when run with wperl, the former works as expected, while the latter (at least with perl v5.22) creates a new console window to run the command. When run with regular perl, the behaviour is identical, perl opens a new console window, and whatever output the command has appears in that window.

From a little investigation, Win32::Process would need to be extended in some manner in order to pass in whatever flag causes CORE::system to hide the console window, and Win32::SetChildShowWindow would possibly need a matching Win32::GetChildShowWindow to be able to read back the current setting..