Quoth [email protected] (Angelos Karageorgiou):
> On 12/1/2010 4:10 μμ, Nele Kosog wrote:
> >
> > I have compiled an executable using the following command:
> > "pp -x --gui -o my_program.exe my_program.pl"
> >
> > While --gui blocks the console window for the main application, it does
> > not seem to prevent other console windows from opening.
> >
> > my_program.pl uses two command line tools to calculate something. When I
> > run the pp'ed executable, the my_program.exe opens a new console window
> > for each call to one of the command line tools.
> >
> > Are there means to prevent this? I have searched for this option, but
> > only find the --gui switch description.
>
> From activeperl's faq, other variants use some other technique maybe ?
>
> BEGIN {
> my ($DOS) = Win32::GUI::GetPerlWindow();
> #hide console window
> if ( $DOS ) {
> Win32::GUI::Hide($DOS) unless ($ARGV[0] eq '--keep');
> }
This part is unnecessary if you already have a GUI executable (there
will be no 'main' console window), which means you don't need to load
WIn32::GUI.
> # hide children windows
> if ( defined &Win32::SetChildShowWindow ){
> Win32::SetChildShowWindow(0);
> }
> }
This is what is required. Win32::SetChildShowWindow should be defined on
all current Win32 builds of perl.
Ben