Win32 process list
![]() | Create () Create a process list object |
![]() | GetNextProcess () Get the next process from the list |
![]() | SnapShot () Create a snapshot of all currently running processes |
![]() | ~CProcessList () Destructor |
Win32 process list. Note that you cannot instantiate an object of this class. Instead you have to use the static member function Create() to obtain a valid object. You have to delete this object, if you no longer need this object. The goal of the Create method is to find the best process enumerator on the current system. On a Win95/98 it uses the toolhelp32 library and on NT it uses the PSAPI or the performance database, if no PSAPI is present. The return of Create() is a pointer to an object of a more specialised class.Usage:
// find out the best process enumerator method CProcessList * pProcessList = CProcessList::Create(); ASSERT(pProcList != 0); // make a snapshot of all running processes pProcessList->SnapShot(); // loop through the processes CProcess * pProcess; while((pProcess = pProcessList->GetNextProcess()) != 0) { // do whatever you want to do with that process } // eventually you want to reuse the object pProcessList->SnapShot(); // ... // if it is no longer needed -> delete it delete pProcessList;
virtual bool SnapShot()
virtual CProcess* GetNextProcess()
virtual ~CProcessList()
generated by doc++