Thanks for your great answer, this is the way I couldn't explain it
in my post, I didn't find the correct words.
I found another great working code:
BEGIN {
Win32::SetChildShowWindow(0)
if defined &Win32::SetChildShowWindow
}
This is doing exactly what I need.
The text was written by Jan Krynicky and is based on discussion on
Perl-Win32-Users mailing list, the code is by Jan Dubois. Source:
http://jenda.krynicky.cz/perl/GUIscripts.html
tinti
-----Original Message-----
From: "Sean Healy" <[EMAIL PROTECTED]>
To: [email protected]
Date: Sun, 04 Jun 2006 11:33:52 -0600
Subject: Re: [perl-win32-gui-users] execute system command
> On Sun, 04 Jun 2006 11:06:40 -0600, tinti <[EMAIL PROTECTED]> wrote:
>
> > I have a problem when executing a command file (.cmd) in perl
> using
> > win32-gui. When I am running my script with perl -w file.pl
> > everything works fine but as soon as I am building an .exe file
> using:
> > pp --gui -I lib -c -i lib\favicon.ico -o file.exe file.pl
> > my program is running all .cmd files in a command prompt box.
>
> First, don't use exec() unless you want your perl script to exit.
> Second, you don't need (and almost certainly don't want) $0 = ...
>
> When you run 'perl -w file.pl', you're running it in a command
> prompt
> (although you may be hiding it at the start of your program). In
> this
> case, the system reuses your existing prompt box. But when you run
> it as
> 'file.exe', you don't have one, so the system makes one for you.
>
> I don't have much experience with PAR, but I suspect that taking off
> the
> --gui option will fix your problem. Of course, then you'd get the
> flicker
> of the command prompt window showing up briefly before being hidden.
>
> While I have not tried it, a quick gance at the documentation
> suggests
> that Win32::Console might be another way to go; the docs indicate
> you can
> create a console in memory.
>
>
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/