Win32::Process - Create and manipulate processes. |
Win32::Process - Create and manipulate processes.
use Win32::Process; use Win32;
sub ErrorReport{ print 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);
This module provides access to the process control functions in the Win32 API.
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 returns non-zero on success, 0 on failure.
Suspend()
Resume()
Kill($exitcode)
GetPriorityClass($class)
SetPriorityClass($class)
SetProcessAffinityMask($processAffinityMask)
GetExitCode($exitcode)
Wait($timeout)
INFINITE
.
GetProcessID()
GetCurrentProcessID()
returns the windows PID as needed for all
the Win32::Process functions.
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
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Win32::Process - Create and manipulate processes. |