Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Wperl.exe fails with Tk + piped process ( Win32 )

by chessgui (Scribe)
on Jan 10, 2012 at 10:43 UTC ( [id://947139]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Wperl.exe fails with Tk + piped process ( Win32 )
in thread Wperl.exe fails with Tk + piped process ( Win32 )

Now this post has been useful. Thanks a lot.

Unfortunately I could not test the Win32::GUI solution (since I can't build Win32::GUI due to make errors), but luckily there is an example code which does the same in slightly more complicated way by using Win32::API (which installs on my system seamlessly).

This latter code works for me after some massaging. Though the consolde window is created but is shut down immediately.

Thanks again, this is a perfect solution.
  • Comment on Re^4: Wperl.exe fails with Tk + piped process ( Win32 )

Replies are listed 'Best First'.
Re^5: Wperl.exe fails with Tk + piped process ( Win32 )
by Anonymous Monk on Jan 10, 2012 at 11:15 UTC

    You know, its trivial to create a tiny gui win32 .exe, which sets up all the console hiding stuff, and then launches a hidden perl.exe as opposed to wperl.exe

    or you could simply use wperl.exe , call the hiding children function, then launch a hidden perl.exe

      It works! You only have to take care to create the Win32::Process object with creation flag: CREATE_NO_WINDOW.

      I copy the code should anyone need it.

      So, run this script via wperl.exe from the working directory of the main script (let's say that the path to perl.exe is 'c:\strawberry\perl\bin' and the main script is called 'gui.pl'):

      use Win32::Process; Win32::Process::Create($perl,'c:\strawberry\perl\bin\perl.exe','perl.e +xe gui.pl',0,CREATE_NO_WINDOW,'.');


      In the main script include:

      use Win32 qw(SW_HIDE); Win32::SetChildShowWindow(SW_HIDE);


      In this framework no console window is opened and the Open2 call is safe.
        Or you could  wperl fudge.pl
        my $perl = $^X; $perl =~ s/wperl.exe/perl.exe/i; use Win32 qw(SW_HIDE); Win32::SetChildShowWindow(SW_HIDE); system(1, $perl, '-le', 'warn(666);close STDOUT;use Win32;Win32::MsgBo +x(0);' );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://947139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found