[ WhoSLocking | Source | Keywords | Summary | Ancestors | All Members | Descendants ]
Back to the top of CSimpleProcessAPI
This class provides a simple and cross-platform (Windows NT, Windows 98) access to processes and modules (DLLs).
Back to the top of CSimpleProcessAPI
To use this class:
Back to the top of CSimpleProcessAPI
// Create instance of the class CSimpleProcessAPI oProcessAPI;
// Build list of running processes CMapStringToString oProcessPIDNameMap; if (oProcessAPI.BuildProcessList(oProcessPIDNameMap)) {
POSITION hProcessPosition = NULL;
// Loop on all processes and print their names hProcessPosition = PIDNameMap.GetStartPosition();
if (hProcessPosition != NULL) { cout << "PID\t\tProcess Name\n"; while (hProcessPosition != NULL) { CString ProcessName; CString PIDString; PIDNameMap.GetNextAssoc( hProcessPosition, PIDString, ProcessName ); cout << PIDString << "\t\t" << ProcessName; } } }
Back to the top of CSimpleProcessAPI
Author Emmanuel KARTMANN
Date Monday 12/6/99
Back to the top of CSimpleProcessAPI
Back to the top of CSimpleProcessAPI
Purpose: create an instance of the class
Parameters: none (C++ constructor)
Return value : none (C++ constructor)
Description : This function loads the system DLL (PSAPI.DLL for Windows NT and TOOLHLP32.DLL for Windows 9x) needed to build processes and module lists.
CSimpleProcessAPI();
Back to the top of CSimpleProcessAPI
Purpose: delete an instance of the class
Parameters: none (C++ destructor)
Return value : none (C++ destructor)
Description :
virtual ~CSimpleProcessAPI();
Back to the top of CSimpleProcessAPI
BOOL BuildProcessList(CMapStringToString &ProcessPIDNameMap);
Purpose: builds the list of running processes
Parameters:
Description :
BOOL BuildProcessList(CMapStringToString &ProcessPIDNameMap);
Back to the top of CSimpleProcessAPI
BOOL BuildModuleList(DWORD nCurrentPID, CStringList &ModuleFileNameList);
Purpose: builds the list of modules (DLLs) loaded by a given process.
Parameters:
Description :
BOOL BuildModuleList(DWORD nCurrentPID, CStringList &ModuleFileNameList);
Back to the top of CSimpleProcessAPI
Purpose: find the process(es) who is (are) locking a given module (DLL).
Parameters:
Description :
BOOL GetProcessesLockingModule(LPCTSTR lpszModuleName, CMapStringToString &PIDNameMap, CMapStringToString &oLoadingProcessMap);
Back to the top of CSimpleProcessAPI
DWORD GetFirstProcessLockingModule(LPCTSTR lpszModuleName, CMapStringToString &PIDNameMap);
Purpose: find the first process who is locking a given module (DLL).
Parameters:
Description : Implemented via GetProcessesLockingModule()
DWORD GetFirstProcessLockingModule(LPCTSTR lpszModuleName, CMapStringToString &PIDNameMap);
Back to the top of CSimpleProcessAPI
CString GetProcessExecutableName(DWORD dwProcessID);
Purpose: returns the name of the process's executable
Parameters:
Description : This function considers that the executable is a module loaded by the process whose file name extension is ".EXE"
CString GetProcessExecutableName(DWORD dwProcessID);
Back to the top of CSimpleProcessAPI
BOOL TerminateProcess(DWORD dwProcessID);
Purpose: terminate a process (forcefully)
Parameters:
Description :
static BOOL TerminateProcess(DWORD dwProcessID);
Back to the top of CSimpleProcessAPI
Back to the top of CSimpleProcessAPI
Back to the top of CSimpleProcessAPI
Back to the top of CSimpleProcessAPI
Report problems to jkotula@stratasys.com