DumontEXE 0.0.1
Plist.cpp
00001 //
00002 // Plist.cpp: Demonstrates use of CTaskManager class
00003 //
00004 
00005 #include "ModuleInstance.h"
00006 
00007 
00008 int main(int argc, char* argv[])
00009 {
00010     CTaskManager           taskManager;
00011     CExeModuleInstance     *pProcess;
00012     CModuleInstance        *pModule;
00013 
00014     // Retrieves information about processes and modules.  
00015     // The taskManager dynamically decides whether to use ToolHelp library or PSAPI
00016     taskManager.Populate();
00017 
00018     // Enumerates all processes
00019     for (unsigned i = 0; i < taskManager.GetProcessCount(); i++)
00020     {
00021         pProcess = taskManager.GetProcessByIndex(i);
00022         printf("Process %s pid=%d\n", pProcess->Get_Name(), pProcess->Get_ProcessId());
00023 
00024         // Enumerates all modules loaded by (pProcess) process
00025         for (unsigned j = 0; j < pProcess->GetModuleCount(); j++)
00026         {
00027             pModule = pProcess->GetModuleByIndex(j);
00028             printf("\t %s Handle=%.8x\n", pModule->GetBaseName(), pModule->Get_Module());
00029         } // for
00030     } // for
00031 
00032     return 0;
00033 }
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com