Struct winsafe::HPROCESSLIST [−][src]
#[repr(C)]pub struct HPROCESSLIST { /* fields omitted */ }
Expand description
Handle to a process list
snapshot.
Originally just a HANDLE
.
Examples
Listing the names of all processes currently running, along with their process ID and number of execution threads:
use winsafe::{co, HPROCESSLIST, PROCESSENTRY32};
let mut pe = PROCESSENTRY32::default();
let hpl = HPROCESSLIST::CreateToolhelp32Snapshot(co::TH32CS::SNAPPROCESS, None)?;
if hpl.Process32First(&mut pe)? {
loop {
println!("{} {} {}", pe.szExeFile(), pe.th32ProcessID, pe.cntThreads);
if !hpl.Process32Next(&mut pe)? {
break;
}
}
}
hpl.CloseHandle()?;
Implementations
Creates a new handle instance by wrapping a pointer.
This method is common to all handle types.
Consumes the handle returning the underlying raw pointer.
This method is common to all handle types.
Tells if the handle is invalid (null).
This method is common to all handle types.
Consumes the handle into an option, which is None
if the handle
pointer is null.
This method is common to all handle types.
CloseHandle
method.
pub fn CreateToolhelp32Snapshot(
flags: TH32CS,
th32_process_id: Option<u32>
) -> WinResult<HPROCESSLIST>
pub fn CreateToolhelp32Snapshot(
flags: TH32CS,
th32_process_id: Option<u32>
) -> WinResult<HPROCESSLIST>
CreateToolhelp32Snapshot
static method.
Note: Must be paired with an
HPROCESSLIST::CloseHandle
call.
Process32First
method.
Process32Next
method.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more