Jul 11, 2001 #1 gagou Programmer Jul 11, 2001 1 FR how do I get the PID from the name of the process under NT4 ?
Jul 11, 2001 #2 Cagliostro Programmer Sep 13, 2000 4,226 GB use EnumProcesses John Fill ivfmd@mail.md Upvote 0 Downvote
Jul 11, 2001 #3 IonelBurtan Programmer May 25, 2001 601 RO Suppose you have PID from EnumProcesses or other function called ProcessID: char szProcessName[MAX_PATH] = "unknown"; char szTemp[80]; // Get a handle to the passed-in process ID HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID );//Get the process handle if(hProcess) { HMODULE hMod; DWORD cbNeeded; if(EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) { GetModuleBaseName(hProcess, hMod, szProcessName, sizeof(szProcessName)); } } Hope this helps, s-) Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees... http://www20.brinkster.com/ionelb Upvote 0 Downvote
Suppose you have PID from EnumProcesses or other function called ProcessID: char szProcessName[MAX_PATH] = "unknown"; char szTemp[80]; // Get a handle to the passed-in process ID HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID );//Get the process handle if(hProcess) { HMODULE hMod; DWORD cbNeeded; if(EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded)) { GetModuleBaseName(hProcess, hMod, szProcessName, sizeof(szProcessName)); } } Hope this helps, s-) Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees... http://www20.brinkster.com/ionelb
Jul 11, 2001 #4 IonelBurtan Programmer May 25, 2001 601 RO if you have problems in finding and including psapi.h please read thread116-94375 s-) Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees... http://www20.brinkster.com/ionelb Upvote 0 Downvote
if you have problems in finding and including psapi.h please read thread116-94375 s-) Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees... http://www20.brinkster.com/ionelb