Win32::ToolHelp - Perl extension for obtaining information about currently executing applications |
Win32::ToolHelp - Perl extension for obtaining information about currently executing applications (using the ToolHelp API on Win32)
use Win32::ToolHelp;
# --- prints names of all processes my @ps = Win32::ToolHelp::GetProcesses(); foreach my $p (@ps) { print $$p[8], "\n"; }
# --- prints names of the modules used by the current process my @ms = Win32::ToolHelp::GetProcessModules($$); foreach my $m (@ms) { print $$m[7], "\n"; }
# --- prints name of the current process my @cp = Win32::ToolHelp::GetProcess($$); print $cp[8], "\n";
# --- prints full path to the executable of the current process my @cm = Win32::ToolHelp::GetProcessMainModule($$); print $cm[8], "\n";
# --- prints full path to the executable of the first running perl my @pl = Win32::ToolHelp::SearchProcessMainModule("perl.exe"); print $pl[8], "\n";
The Win32::ToolHelp module provides a Perl interface to the ToolHelp API that is present on Windows 95 or higher or Windows 2000 or higher.
The module exposes functionality for obtaining information about currently executing applications (processes and modules used by the processes).
Retrieves list of all processes currently running on the system. The list
is returned as an array or array references. See GetProcess
for the description of a nested array (information about a single process).
Retrieves list of all modules currently loaded and used by the processes
identified by the process id (pid) passed into. The list is returned
as an array or array references. See GetProcessModule
for the description
of a nested array (information about a single module).
Retrieves information about the process identified by the process id (pid) passed into. The information is returned as an array of these scalars:
The information is the same as in the structure PROCESSENTRY32
filled by the ToolHelp API functions Process32First
and Process32Next
.
Retrieves information about a module of the process identified by the process id (pid) and the module id (mid) passed into. The information is returned as an array of these scalars:
The information is the same as in the structure MODULEENTRY32
filled by the ToolHelp API functions Module32First
and Module32Next
.
Retrieves information about the main executable module of the process
identified by the process id (pid) passed into. The information is
returned as an array of scalars. See GetProcessModule
for the description
of the array.
Retrieves information about the process identified by the process executable
name (pname) passed into. The information is returned as an array
of scalars. See GetProcess
for the description of the array.
Retrieves information about a module of the process identified by
the process id (pid) and the module name (m) passed into.
The information is returned as an array of scalars. See GetProcessModule
for the description of the array.
Retrieves information about the main executable module of the process
identified by the process executable name (p) passed into.
The information is returned as an array of scalars. See GetProcessModule
for the description of the array.
Ferdinand Prantl <prantl@host.sk>
See http://prantl.host.sk/perl/modules/Win32/ToolHelp for the most recent version.
Copyright (c) 2002, Ferdinand Prantl. All rights reserved.
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Author makes no representations about the suitability of this software for any purpose. It is provided ``as is'' without express or implied warranty.
the Win32::Process manpage and the Win32::Job manpage.
Win32::ToolHelp - Perl extension for obtaining information about currently executing applications |