The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Win32::Process - Create and manipulate processes.

SYNOPSIS use Win32::Process; use Win32;

        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);

DESCRIPTION

This module allows for control of processes in Perl.

METHODS

Win32::Process::Create($obj,$appname,$cmdline,$iflags,$cflags,$curdir)

Creates a new process.

    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
$ProcessObj->Suspend()

Suspend the process associated with the $ProcessObj.

$ProcessObj->Resume()

Resume a suspended process.

$ProcessObj->Kill( $ExitCode )

Kill the associated process, have it die with exit code $ExitCode.

$ProcessObj->GetPriorityClass($class)

Get the priority class of the process.

$ProcessObj->SetPriorityClass( $class )

Set the priority class of the process (see exported values below for options).

$ProcessObj->GetprocessAffinitymask( $processAffinityMask, $systemAffinitymask)

Get the process affinity mask. This is a bitvector in which each bit represents the processors that a process is allowed to run on.

$ProcessObj->SetprocessAffinitymask( $processAffinityMask )

Set the process affinity mask.

$ProcessObj->GetExitCode( $ExitCode )

Retrieve the exitcode of the process.

$ProcessObj->Wait($Timeout)

Wait for the process to die. forever = INFINITE