in reply to Creating an independent process in Win32
What you're looking for is the Wait method. Here's a little example I whipped up:
use strict; use Win32::Process; my $appname = "c:\\winnt\\notepad.exe"; my $cmdline = "notepad"; my $inherit = 0; my $flags = 'NORMAL_PRIORITY_CLASS'; my $currdir = '.'; my $timeout = 5000; # milliseconds my $ProcObj; Win32::Process::Create($ProcObj,$appname,$cmdline,$inherit,$flags,$cur +rdir) || die &ErrorReport(); $ProcObj->Wait($timeout); print "Done!\n"; sub ErrorReport { print Win32::FormatMessage( Win32::GetLastError() ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Creating an independent process in Win32
by Hot Pastrami (Monk) on May 08, 2001 at 02:34 UTC |