Win32::Process - Create and manipulate processes.
print Win32::FormatMessage( Win32::GetLastError() );
".")|| die ErrorReport();
This module provides access to the process control functions in the Win32 API.
Creates a new process.
$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
Returns non-zero on success, 0 on failure.
Creates a handle Perl can use to an existing process as identified by $pid. The $iflags is the inherit flag that is passed to OpenProcess. Currently Win32::Process objects created using Win32::Process::Open cannot Suspend or Resume the process. All other calls should work.
Win32::Process::Open returns non-zero on success, 0 on failure.
Terminates any process identified by $pid. $exitcode will be set to the exit code of the process.
Suspend the process associated with the $ProcessObj.
Resume a suspended process.
Kill the associated process, have it terminate with exit code $ExitCode.
Get the priority class of the process.
Set the priority class of the process (see exported values below for options). Note that the ABOVE_NORMAL_PRIORITY_CLASS and BELOW_NORMAL_PRIORITY_CLASS classes only work on Windows 2000 and later.
Get the process affinity mask. This is a bitvector in which each bit represents the processors that a process is allowed to run on.
Set the process affinity mask. Only available on Windows NT.
Retrieve the exitcode of the process. Will return STILL_ACTIVE if the process is still running. The STILL_ACTIVE constant is only exported by explicit request.
Wait for the process to die. $timeout should be specified in milliseconds. To wait forever, specify the constant INFINITE.
Returns the Process ID.
Returns the current process ID, which is the same as $$. But not on cygwin, where $$ is the cygwin-internal PID and not the windows PID. On cygwin GetCurrentProcessID() returns the windows PID as needed for all the Win32::Process functions.
The following constants are exported by default:
The following additional constants are exported by request only:
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Win32::Process, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.