sub ErrorReport{
print Win32::FormatMessage( Win32::GetLastError() );
}
Win32::Process::Create($ProcessObj,
"D:\\winnt35\\system32\\notepad.exe",
"notepad temp.txt",
0,
NORMAL_PRIORITY_CLASS,
".")|| die ErrorReport();
$ProcessObj->Suspend();
$ProcessObj->Resume();
$ProcessObj->Wait(INFINITE);
Args:
$obj container for process object
$appname full path name of executable module
$cmdline command line args
$iflags flag: inherit calling processes handles or not
$cflags flags for creation (see exported vars below)
$curdir working dir of new process
$wShowWindow - one of
SW_ flags (for more info look at <Win32\winuser.h> or Win32API docs). This is how child process window will be opened
(normal, minimized, maximized).
The most useful flags are:
SW_SHOWNORMAL
SW_SHOWMINIMIZED
SW_SHOWMAXIMIZED
SW_SHOWNOACTIVATE
Another optional parameter $Title defines the title displayed in the title bar if a new console window is
created (with CREATE_NEW_CONSOLE flag).
$ProcessObj->GetExitCode($ExitCode);
when process is still active.
Changes by Mike Blazer <blazer@mail.nevalink.ru>