winapi_common
|
Create a new process or open an existing process. More...
Public Types | |
using | ID = DWORD |
Public Member Functions | |
ID | get_id () const |
const Handle & | get_handle () const |
bool | is_running () const |
void | wait () const |
void | terminate (int ec=0) const |
void | shut_down (int ec=0) const |
int | get_exit_code () const |
std::string | get_exe_path () const |
Static Public Member Functions | |
static Process | create (ProcessParameters) |
static Process | create (const CommandLine &) |
static Process | create (const CommandLine &, process::IO) |
static Process | shell (const ShellParameters &) |
static Process | shell (const CommandLine &) |
static Process | current () |
static Process | open (ID id, DWORD permissions=default_permissions()) |
static Process | open_r (ID) |
static DWORD | default_permissions () |
static DWORD | read_permissions () |
static Resource | get_resource (uint32_t id) |
static std::string | get_resource_string (uint32_t id) |
Create a new process or open an existing process.
Definition at line 54 of file process.hpp.
|
static |
Create a new process using ProcessParameters.
Definition at line 241 of file process.cpp.
|
static |
Create a new process using the given command line.
Definition at line 245 of file process.cpp.
|
static |
Create a new process using the given command line and IO settings.
Definition at line 250 of file process.cpp.
|
static |
Create a new shell process using ShellParameters.
Definition at line 256 of file process.cpp.
|
static |
Create a new shell process using the given command line.
Definition at line 260 of file process.cpp.
|
static |
Open the current process.
Definition at line 265 of file process.cpp.
|
static |
Open an existing process.
id | Process ID. |
permissions | Required permissions. |
Definition at line 269 of file process.cpp.
|
static |
Open an existing process with read permissions.
Definition at line 273 of file process.cpp.
|
static |
Permissions that allow to query process's status.
Definition at line 277 of file process.cpp.
|
static |
Permissions that allows to read process's memory.
Definition at line 281 of file process.cpp.
|
inline |
Get this process's ID.
Definition at line 87 of file process.hpp.
|
inline |
Get this process's handle.
Definition at line 89 of file process.hpp.
bool winapi::Process::is_running | ( | ) | const |
Check if this process is running (i.e. not terminated).
Definition at line 285 of file process.cpp.
void winapi::Process::wait | ( | ) | const |
Wait for the process to terminate.
Definition at line 301 of file process.cpp.
void winapi::Process::terminate | ( | int | ec = 0 | ) | const |
Make this process terminate with an exit code.
Definition at line 315 of file process.cpp.
void winapi::Process::shut_down | ( | int | ec = 0 | ) | const |
Same as calling terminate() and wait().
Definition at line 321 of file process.cpp.
int winapi::Process::get_exit_code | ( | ) | const |
Get terminated process's exit code.
Definition at line 326 of file process.cpp.
std::string winapi::Process::get_exe_path | ( | ) | const |
Get this process's executable path.
Definition at line 342 of file process.cpp.
|
static |
Get a binary resource from the process's executable.
Definition at line 370 of file process.cpp.
|
static |
Get a string resource from the process's executable.
Definition at line 358 of file process.cpp.