Track other processes in the computer
-
Hi All, Currently I'm developing a tool, for that purpose i have to know all other processes running on the computer and achieve the handle of specified process.There are some functions in VB and but i need to write in MFC only... How can get it? bye kamalesh
kamalesh
-
Hi All, Currently I'm developing a tool, for that purpose i have to know all other processes running on the computer and achieve the handle of specified process.There are some functions in VB and but i need to write in MFC only... How can get it? bye kamalesh
kamalesh
-
Hi All, Currently I'm developing a tool, for that purpose i have to know all other processes running on the computer and achieve the handle of specified process.There are some functions in VB and but i need to write in MFC only... How can get it? bye kamalesh
kamalesh
-
Hi All, Currently I'm developing a tool, for that purpose i have to know all other processes running on the computer and achieve the handle of specified process.There are some functions in VB and but i need to write in MFC only... How can get it? bye kamalesh
kamalesh
Does
EnumProcesses
helpful?
WhiteSky
-
Hi All, Currently I'm developing a tool, for that purpose i have to know all other processes running on the computer and achieve the handle of specified process.There are some functions in VB and but i need to write in MFC only... How can get it? bye kamalesh
kamalesh
Pls Find answer to your code.... I dont know how i can attach a file to code project message. there fore please copy from the message... /* Header File for the Class /* #include "stdafx.h" #include "psapi.h" #pragma pack(16) #define FOUND_WJRU 0 #define WJRU_NOTFOUND 1 class CProcessMonitor { private: DWORD mAvailableProcesses[1024], cbNeeded, cProcesses; public: UINT getTotalAvailableProcesses(); UINT getProcessTimes(); BOOL FindProcessandMemoryDetails(DWORD processID,CString Processname,PROCESS_MEMORY_COUNTERS& psmemCounters); BOOL IsProcessMatchingNameAndID( DWORD processID, UINT index ); HANDLE GetProcessHandle(DWORD processID, CString Processname); HANDLE GetHandleToProcess(CString Processname); void GetJRUStatus(int&nStatus, PROCESS_MEMORY_COUNTERS& psMemInfo); }; #pragma pack() /// CPLUSS PLUS FILE.... #include "stdafx.h" #include "psapi.h" #include "EnumProcess.h" BOOL CProcessMonitor::IsProcessMatchingNameAndID( DWORD processID, UINT index ) { char szProcessName[MAX_PATH] = "unknown"; char szTargetProcessName[MAX_PATH] = "Wjru.exe"; PROCESS_MEMORY_COUNTERS psmemCounters; // Get a handle to the process. HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID ); // Get the process name. if ( hProcess ) { HMODULE hMod; DWORD cbNeeded; if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod), &cbNeeded) ) { GetModuleBaseName( hProcess, hMod, szProcessName, sizeof(szProcessName) ); if(strcmp(szProcessName,szTargetProcessName) ==0) { GetProcessMemoryInfo(hProcess,&psmemCounters,sizeof(PROCESS_MEMORY_COUNTERS)); return TRUE; } else { return FALSE; } } } return FALSE; } BOOL CProcessMonitor::FindProcessandMemoryDetails(DWORD processID, CString Processname,PROCESS_MEMORY_COUNTERS& psmemCounters) { char szProcessName[MAX_PATH] = "unknown"; char szTargetProcessName[MAX_PATH]; strcpy(szTargetProcessName,Processname.GetBuffer(50)); Processname.ReleaseBuffer(); // Get a handle to the process. HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID ); // Get the process name. if ( hPro
-
Pls Find answer to your code.... I dont know how i can attach a file to code project message. there fore please copy from the message... /* Header File for the Class /* #include "stdafx.h" #include "psapi.h" #pragma pack(16) #define FOUND_WJRU 0 #define WJRU_NOTFOUND 1 class CProcessMonitor { private: DWORD mAvailableProcesses[1024], cbNeeded, cProcesses; public: UINT getTotalAvailableProcesses(); UINT getProcessTimes(); BOOL FindProcessandMemoryDetails(DWORD processID,CString Processname,PROCESS_MEMORY_COUNTERS& psmemCounters); BOOL IsProcessMatchingNameAndID( DWORD processID, UINT index ); HANDLE GetProcessHandle(DWORD processID, CString Processname); HANDLE GetHandleToProcess(CString Processname); void GetJRUStatus(int&nStatus, PROCESS_MEMORY_COUNTERS& psMemInfo); }; #pragma pack() /// CPLUSS PLUS FILE.... #include "stdafx.h" #include "psapi.h" #include "EnumProcess.h" BOOL CProcessMonitor::IsProcessMatchingNameAndID( DWORD processID, UINT index ) { char szProcessName[MAX_PATH] = "unknown"; char szTargetProcessName[MAX_PATH] = "Wjru.exe"; PROCESS_MEMORY_COUNTERS psmemCounters; // Get a handle to the process. HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID ); // Get the process name. if ( hProcess ) { HMODULE hMod; DWORD cbNeeded; if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod), &cbNeeded) ) { GetModuleBaseName( hProcess, hMod, szProcessName, sizeof(szProcessName) ); if(strcmp(szProcessName,szTargetProcessName) ==0) { GetProcessMemoryInfo(hProcess,&psmemCounters,sizeof(PROCESS_MEMORY_COUNTERS)); return TRUE; } else { return FALSE; } } } return FALSE; } BOOL CProcessMonitor::FindProcessandMemoryDetails(DWORD processID, CString Processname,PROCESS_MEMORY_COUNTERS& psmemCounters) { char szProcessName[MAX_PATH] = "unknown"; char szTargetProcessName[MAX_PATH]; strcpy(szTargetProcessName,Processname.GetBuffer(50)); Processname.ReleaseBuffer(); // Get a handle to the process. HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID ); // Get the process name. if ( hPro
kasturi_haribabu wrote:
I dont know how i can attach a file to code project message
Not yet,but you can use of pre when post a code.;)
WhiteSky
-
Pls Find answer to your code.... I dont know how i can attach a file to code project message. there fore please copy from the message... /* Header File for the Class /* #include "stdafx.h" #include "psapi.h" #pragma pack(16) #define FOUND_WJRU 0 #define WJRU_NOTFOUND 1 class CProcessMonitor { private: DWORD mAvailableProcesses[1024], cbNeeded, cProcesses; public: UINT getTotalAvailableProcesses(); UINT getProcessTimes(); BOOL FindProcessandMemoryDetails(DWORD processID,CString Processname,PROCESS_MEMORY_COUNTERS& psmemCounters); BOOL IsProcessMatchingNameAndID( DWORD processID, UINT index ); HANDLE GetProcessHandle(DWORD processID, CString Processname); HANDLE GetHandleToProcess(CString Processname); void GetJRUStatus(int&nStatus, PROCESS_MEMORY_COUNTERS& psMemInfo); }; #pragma pack() /// CPLUSS PLUS FILE.... #include "stdafx.h" #include "psapi.h" #include "EnumProcess.h" BOOL CProcessMonitor::IsProcessMatchingNameAndID( DWORD processID, UINT index ) { char szProcessName[MAX_PATH] = "unknown"; char szTargetProcessName[MAX_PATH] = "Wjru.exe"; PROCESS_MEMORY_COUNTERS psmemCounters; // Get a handle to the process. HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID ); // Get the process name. if ( hProcess ) { HMODULE hMod; DWORD cbNeeded; if ( EnumProcessModules( hProcess, &hMod, sizeof(hMod), &cbNeeded) ) { GetModuleBaseName( hProcess, hMod, szProcessName, sizeof(szProcessName) ); if(strcmp(szProcessName,szTargetProcessName) ==0) { GetProcessMemoryInfo(hProcess,&psmemCounters,sizeof(PROCESS_MEMORY_COUNTERS)); return TRUE; } else { return FALSE; } } } return FALSE; } BOOL CProcessMonitor::FindProcessandMemoryDetails(DWORD processID, CString Processname,PROCESS_MEMORY_COUNTERS& psmemCounters) { char szProcessName[MAX_PATH] = "unknown"; char szTargetProcessName[MAX_PATH]; strcpy(szTargetProcessName,Processname.GetBuffer(50)); Processname.ReleaseBuffer(); // Get a handle to the process. HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID ); // Get the process name. if ( hPro
Thanks for this nice and beutiful code. Thanks to all....All are helpfuls. Thanks again.
kamalesh