perl Win32::Process 进程管理
来源:互联网 发布:angular 1.0.7.min.js 编辑:程序博客网 时间:2024/05/18 09:07
NAME
Win32::Process - Create and manipulate processes.
SYNOPSIS
use
Win32::Process;
use
Win32;
sub
ErrorReport{
Win32::FormatMessage( Win32::GetLastError() );
}
Win32::Process::Create(
$ProcessObj
,
"C:\\winnt\\system32\\notepad.exe"
,
"notepad temp.txt"
,
0,
NORMAL_PRIORITY_CLASS,
"."
)||
die
ErrorReport();
$ProcessObj
->Suspend();
$ProcessObj
->Resume();
$ProcessObj
->Wait(INFINITE);
DESCRIPTION
This module provides access to the process control functions in the Win32 API.
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
Returns non-zero on success, 0 on failure.
- Win32::Process::Open($obj,$pid,$iflags)
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.
- Win32::Process::KillProcess($pid, $exitcode)
Terminates any process identified by $pid. $exitcode will be set to the exit code of the 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 terminate 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). Note that the ABOVE_NORMAL_PRIORITY_CLASS and BELOW_NORMAL_PRIORITY_CLASS classes only work on Windows 2000 and later.
- $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. Only available on Windows NT.
- $ProcessObj->GetExitCode($exitcode)
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.
- $ProcessObj->Wait($timeout)
Wait for the process to die. $timeout should be specified in milliseconds. To wait forever, specify the constant
INFINITE
.- $ProcessObj->GetProcessID()
Returns the Process ID.
- Win32::Process::GetCurrentProcessID()
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.
EXPORTS
The following constants are exported by default:
CREATE_DEFAULT_ERROR_MODE
CREATE_NEW_CONSOLE
CREATE_NEW_PROCESS_GROUP
CREATE_NO_WINDOW
CREATE_SEPARATE_WOW_VDM
CREATE_SUSPENDED
CREATE_UNICODE_ENVIRONMENT
DEBUG_ONLY_THIS_PROCESS
DEBUG_PROCESS
DETACHED_PROCESS
HIGH_PRIORITY_CLASS
IDLE_PRIORITY_CLASS
INFINITE
NORMAL_PRIORITY_CLASS
REALTIME_PRIORITY_CLASS
THREAD_PRIORITY_ABOVE_NORMAL
THREAD_PRIORITY_BELOW_NORMAL
THREAD_PRIORITY_ERROR_RETURN
THREAD_PRIORITY_HIGHEST
THREAD_PRIORITY_IDLE
THREAD_PRIORITY_LOWEST
THREAD_PRIORITY_NORMAL
THREAD_PRIORITY_TIME_CRITICAL
The following additional constants are exported by request only:
ABOVE_NORMAL_PRIORITY_CLASS
BELOW_NORMAL_PRIORITY_CLASS
STILL_ACTIVE
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
- perl Win32::Process 进程管理
- perl 中的进程管理
- perl进程管理
- Win32 进程间示例代码 Process 2
- Win32 进程间互斥示例代码 Process 1
- Win32 进程间示例代码 Process 2
- Win32 进程间互斥示例代码 Process 1
- Perl笔记14、进程管理
- Perl 脚本自动杀死指定process 所有进程
- 使用Process类对进程进行管理
- Perl语言入门——进程管理
- 进程-process
- Process 进程
- 进程process
- Process进程
- swoole教程第一节:进程管理模块(Process)-中(消息队列)
- Atitit js nodejs下的进程管理wmic process进程管理
- Embedding Perl under Win32
- cpu五级流水线基础设计
- Jibx 处理XML
- Linux集群入门之:正明的lvs
- 条件注释判断浏览器<!--[if !IE]><!--[if IE]><!--[if lt IE 6]><!--[if gte IE 6]>
- Android大图片裁剪终极解决方案(中:从相册截图)
- perl Win32::Process 进程管理
- 国内哪家免费自助建站系统好用
- Dynpro F4的实现测试
- fedora16 python2.6 升级至python2.7.9
- Android大图片裁剪终极解决方案(下:拍照截图)
- 影子侠开发者-数据库加密SDK详细说明文档
- ogre学习笔记-基础教程345
- iOS开发ARC内存管理技术要点
- ADO.Net之手机号码归属地查询