Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Hiding DOS windows that accompany TK

by Erez (Curate)
on Dec 08, 2008 at 13:12 UTC ( #728932=note: print w/ replies, xml ) Need Help??


in reply to Hiding DOS windows that accompany TK

I borrowed this from the Perl Cookbook a while ago:

use strict; use warnings; use Win32; use Win32::Process; my $program = shift @ARGV or die "Usage: loader.pl program\n"; Win32::Process::Create($Win32::Process::Create::ProcessObj, 'd:\strawberry\perl\bin\perl.exe', #or wherever perl.exe is locate +d "perl.exe $program", 0, DETACHED_PROCESS, '.') or die print_error(); sub print_error { return Win32::FormatMessage( Win32::GetLastError() ); }

"A core tenant of the greater Perl philosophy is to trust that the developer knows enough to solve the problem" - Jay Shirley, A case for Catalyst.


Comment on Re: Hiding DOS windows that accompany TK
Download Code
Re^2: Hiding DOS windows that accompany TK
by Popcorn Dave (Abbot) on Dec 08, 2008 at 19:06 UTC
    Did that actually work for you? I tried something similar from the Cookbook, although it may have been an earlier edition and couldn't get it to work. However after trolling the net, I found that by adding
    $Win32::Process::Create::ProcessObj -> Resume();
    after the code that you have, did the trick.


    To disagree, one doesn't have to be disagreeable - Barry Goldwater

      It did and it does. I don't recall whether this is lifted verbatim off the cookbook or whether I altered anything. I placed that code in a file a year or two ago, and have been only updating the path, and calling it.

      "A core tenant of the greater Perl philosophy is to trust that the developer knows enough to solve the problem" - Jay Shirley, A case for Catalyst.

        Interesting. I could never get it to work without the last line. Maybe I had an older incarnation of the cookbook.


        To disagree, one doesn't have to be disagreeable - Barry Goldwater

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2014-07-13 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (248 votes), past polls