home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeJava and XSLTSearch this book

22.14. Win32::Process

This module provides access to extended Win32 process creation and management abilities. Process objects are created with the Create method (the constructor). Additional methods can be used on objects to kill, suspend, resume, and set the priorities of processes.

The Create constructor has the following syntax:

Win32::Process->Create($Proc, app, cmnd, hndls, opts, dir)

The arguments to Create are as follows:

Name of the reference for the created process object.

Full pathname of the executable.

Command line for executable.

Determines handle inheritance. A value of 1 turns on inheritance; a 0 value turns it off.

Sets options to implement when the process is created. The available options for this argument are listed below.

The working directory for the executable.

The process is created by passing the command line in cmnd to the executable named in app. For example, a process object for a text file running in Notepad is created like this:

use Win32::Process;
Win32::Process->Create($proc, 'C:\\windows\\Notepad.exe',
                       "Notepad perlnut.txt", 1, 
                       DETACHED_PROCESS, ".");

The process creation options given by the opts argument to Create are:

Gives the process the default error mode.

Creates a new console for the process. Can't be used with DETACHED_PROCESS.

Creates a new process, but without running the process in a new and visible window. That is, a new process will be created, but in the background.

Creates process as root of a new process group.

Runs process in its own Virtual DOS Machine (VDM). Only applicable to 16-bit applications.

Starts process in a suspended state. The process can be started with the Resume method.

Uses Unicode characters in the environment block of the new process.

Debugs the new process with the calling process.

Doesn't debug the new process if calling process is being debugged.

Creates a process with no access to the console of the calling process.

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.