On Mon, 28 Apr 2008, Michael Ellery wrote:
> 
> ..I use this function pretty regularly to spawn procs on windows, but
> I've often wanted to minimize the console or main window that was
> launched.  Does anyone know how to do this?  In the corresponding WIN32
> API, there is a STARTUPINFO structure that allows this, but looks like
> it's not part of the Win32::Process API.  Advice appreciated.

You cannot do this currently with Win32::Process, so you may want
to file an enhancement request at

    http://rt.cpan.org/Public/Dist/Display.html?Name=Win32-Process

You could achieve the functionality with the standard system()
function though.  Just call e.g.

    Win32::SetChildShowWindow(Win32::SW_SHOWMINIMIZED);
or
    Win32::SetChildShowWindow(Win32::SW_HIDE);

to run processes minimized, or even without a window at all.
See `perldoc Win32` for the Win32""SetChildShowWindow() docs.

If you need to wait for your subprocesses, then you may want
to use this somewhat obscure form:

    my $pid = system(1, $cmdline);
    # ...
    waitpid $pid, 0;

(This is documented in `perldoc perlport` as a Win32 specific extension
to system(), but not mentioned in `perldoc -f system`).

Cheers,
-Jan


_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to