![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cOSProcessX.h>
Public Member Functions | |
cOSProcessX () | |
virtual | ~cOSProcessX () |
HRESULT | StartProcess (const FILECHAR_t *pszExeName, const FILECHAR_t *pszArgs=nullptr, TIMESYSD_t nTimeWait=cTimeSys::k_CLEAR, SHOWWINDOW_t nShowCmd=SW_SHOWNORMAL, const FILECHAR_t *pszCurrentDir=nullptr, const FILECHAR_t *pszFileOutPipe=nullptr, OUT APP_EXITCODE_t *pnExitCode=nullptr) |
HRESULT | StartProcessCmd (const FILECHAR_t *pszCmd, const FILECHAR_t *pszDocument, TIMESYSD_t nWait=cTimeSys::k_INF, SHOWWINDOW_t nShowCmd=SW_SHOWNORMAL) |
HRESULT | ShellExec (const FILECHAR_t *pszVerb, const FILECHAR_t *pszDocument, const FILECHAR_t *pszMimeType=nullptr, SHOWWINDOW_t nShowCmd=SW_SHOWNORMAL, const FILECHAR_t *pszParams=nullptr, const FILECHAR_t *pszDir=nullptr) |
UNITTEST2_PREDEF (cOSProcessX) | |
![]() | |
cOSProcess () noexcept | |
virtual | ~cOSProcess () |
HRESULT | CreateProcessX (const FILECHAR_t *pszExeName, const FILECHAR_t *pszArgs=nullptr, SHOWWINDOW_t nShowCmd=SW_SHOWNORMAL, const FILECHAR_t *pszCurrentDir=nullptr, cFile *pFileOutPipe=nullptr) |
bool | isValidProcess () const noexcept |
PROCESSID_t | get_ProcessId () const noexcept |
virtual cStringF | get_ProcessPath () const |
cStringF | get_ProcessName () const |
HRESULT | OpenProcessId (PROCESSID_t dwProcessID, DWORD dwDesiredAccess=0, bool bInheritHandle=false) |
cStringF | get_CommandLine () const |
HRESULT | WaitForProcessExit (TIMESYSD_t nTimeWait, APP_EXITCODE_t *pnExitCode=nullptr) |
void | AttachCurrentProcess () noexcept |
HRESULT | TerminateProcess (APP_EXITCODE_t uExitCode) |
DWORD | get_PriorityClass () const noexcept |
CPU priority level for scheduling. More... | |
bool | put_PriorityClass (DWORD dwPriorityClass) noexcept |
Static Public Member Functions | |
static HRESULT GRAYCALL | EnumProcesses (OUT PROCESSID_t *pnProcessIDs, COUNT_t iQtyMax) |
static HRESULT GRAYCALL | FindProcessByName (const FILECHAR_t *pszName, OUT PROCESSID_t *pnProcessIDs, COUNT_t iInstQty) |
static bool GRAYCALL | FindCmdForMime (OUT FILECHAR_t *pszExeNameRet, StrLen_t iLenNameMax, const FILECHAR_t *pszMimeType) |
![]() | |
static bool __stdcall | IsSystemPID (PROCESSID_t nProcessID) noexcept |
Additional Inherited Members | |
![]() | |
PROCESSID_t | m_nPid |
Process ID, 0 = PROCESSID_BAD = un-init. More... | |
A process in the system. May or may not be the current process. or one that i started. handle to some active process. Related to MIME_EXT_exe PROCESSID_t
GrayLib::cOSProcessX::cOSProcessX | ( | ) |
|
virtual |
|
static |
Get a list of all the process id's that i can see. All users.
|
static |
Get the process/app name for a given MIME class or file/document extension.
|
static |
Find a process by name OR full path name. iInstQtyMax = if there are multiple instances get this many.
HRESULT GrayLib::cOSProcessX::ShellExec | ( | const FILECHAR_t * | pszVerb, |
const FILECHAR_t * | pszDocument, | ||
const FILECHAR_t * | pszMimeType = nullptr , |
||
SHOWWINDOW_t | nShowCmd = SW_SHOWNORMAL , |
||
const FILECHAR_t * | pszParams = nullptr , |
||
const FILECHAR_t * | pszDir = nullptr |
||
) |
Open a document with some registered external application type handler. For linux this is a MIME type ?
HRESULT GrayLib::cOSProcessX::StartProcess | ( | const FILECHAR_t * | pszExeName, |
const FILECHAR_t * | pszArgs = nullptr , |
||
TIMESYSD_t | nTimeWait = cTimeSys::k_CLEAR , |
||
SHOWWINDOW_t | nShowCmd = SW_SHOWNORMAL , |
||
const FILECHAR_t * | pszCurrentDir = nullptr , |
||
const FILECHAR_t * | pszFileOutPipe = nullptr , |
||
OUT APP_EXITCODE_t * | pnExitCode = nullptr |
||
) |
Start up a child process. replaces old WinExec()
HRESULT GrayLib::cOSProcessX::StartProcessCmd | ( | const FILECHAR_t * | pszCmd, |
const FILECHAR_t * | pszDocument, | ||
TIMESYSD_t | nWait = cTimeSys::k_INF , |
||
SHOWWINDOW_t | nShowCmd = SW_SHOWNORMAL |
||
) |
Launch some process. Use a pszCmd that might have "%1" in it to add more args to open the document. E.g. pszCmd = '"%programFiles%\Windows Mail\Wab.exe" /CreateContact "%1"'
GrayLib::cOSProcessX::UNITTEST2_PREDEF | ( | cOSProcessX | ) |