Click here to Skip to main content
15,925,309 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Private constructors and Destructors Pin
Waldermort9-Oct-06 23:17
Waldermort9-Oct-06 23:17 
GeneralRe: Private constructors and Destructors Pin
toxcct9-Oct-06 23:51
toxcct9-Oct-06 23:51 
GeneralRe: Private constructors and Destructors Pin
Hamid_RT10-Oct-06 7:06
Hamid_RT10-Oct-06 7:06 
GeneralRe: Private constructors and Destructors Pin
Stephen Hewitt10-Oct-06 1:19
Stephen Hewitt10-Oct-06 1:19 
QuestionDont Display hidden folders in a Tree Control Pin
kiranin9-Oct-06 21:18
kiranin9-Oct-06 21:18 
AnswerRe: Dont Display hidden folders in a Tree Control Pin
Hamid_RT9-Oct-06 21:46
Hamid_RT9-Oct-06 21:46 
QuestionProcess Information Pin
Daniel Kanev9-Oct-06 21:11
Daniel Kanev9-Oct-06 21:11 
AnswerRe: Process Information Pin
Sujith(ARS)9-Oct-06 21:20
Sujith(ARS)9-Oct-06 21:20 
if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
return NULL;

// Calculate how many process identifiers were returned.

cProcesses = cbNeeded / sizeof(DWORD);

// Print the memory usage for each process

for ( i = 0; i < cProcesses; i++ )
{

CString strFileNamePath, strFileName;
processID = aProcesses[i];

// Print the process identifier.

TRACE( "\nProcess ID: %u\n", processID );

// Get a list of all the modules in this process.

hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ | PROCESS_TERMINATE,
FALSE, processID );

if( EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
{
char szModName[MAX_PATH];

// Get the full path to the module's file.

if ( GetModuleFileNameEx( hProcess, hMods[0], szModName,
sizeof(szModName)))
{
// Print the module name and handle value.

TRACE("\t%s (0x%08X)\n", szModName, hMods[0] );

strFileNamePath.Format("%s", szModName);

strFileName = strFileNamePath.Mid(strFileNamePath.ReverseFind('\\') + 1, strFileNamePath.GetLength());

}
}

CloseHandle( hProcess );

}

this is how you can retrieve the file names of all running process,
similarily there are psapi functions to get memory usage, I/O threads

Cheers,
Sujith
AnswerRe: Process Information Pin
Hamid_RT9-Oct-06 21:46
Hamid_RT9-Oct-06 21:46 
QuestionGetting the current logged in Windows user name Pin
Sujith(ARS)9-Oct-06 20:42
Sujith(ARS)9-Oct-06 20:42 
QuestionRe: Getting the current logged in Windows user name Pin
kakan9-Oct-06 22:12
professionalkakan9-Oct-06 22:12 
AnswerRe: Getting the current logged in Windows user name Pin
Galatei9-Oct-06 23:05
Galatei9-Oct-06 23:05 
AnswerRe: Getting the current logged in Windows user name Pin
Haroon Sarwar9-Oct-06 23:31
Haroon Sarwar9-Oct-06 23:31 
GeneralRe: Getting the current logged in Windows user name Pin
Galatei10-Oct-06 2:22
Galatei10-Oct-06 2:22 
QuestionGetting the current logged in Windows user name when running as an service Pin
Sujith(ARS)9-Oct-06 20:41
Sujith(ARS)9-Oct-06 20:41 
AnswerRe: Getting the current logged in Windows user name when running as an service Pin
Galatei10-Oct-06 1:19
Galatei10-Oct-06 1:19 
QuestionProblem with compiling the VC++ code Pin
Dinu_IP9-Oct-06 20:10
Dinu_IP9-Oct-06 20:10 
AnswerRe: Problem with compiling the VC++ code Pin
Naveen9-Oct-06 21:46
Naveen9-Oct-06 21:46 
QuestionRecursing Subdirectory Pin
ayan_00_arup9-Oct-06 20:00
ayan_00_arup9-Oct-06 20:00 
AnswerRe: Recursing Subdirectory Pin
Naveen9-Oct-06 20:15
Naveen9-Oct-06 20:15 
AnswerRe: Recursing Subdirectory Pin
Hamid_RT9-Oct-06 20:15
Hamid_RT9-Oct-06 20:15 
AnswerRe: Recursing Subdirectory Pin
Galatei10-Oct-06 2:28
Galatei10-Oct-06 2:28 
Questionhow to catch console message Pin
Gongya Yu9-Oct-06 19:27
Gongya Yu9-Oct-06 19:27 
AnswerRe: how to catch console message Pin
Galatei10-Oct-06 2:31
Galatei10-Oct-06 2:31 
GeneralRe: how to catch console message Pin
Gongya Yu10-Oct-06 5:04
Gongya Yu10-Oct-06 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.