PID vom explorer
-
Gibt es eine funktion mit der man nur mit namen von der exe die pid rausbekommt???
oder geht das nur mit GetWindowThreadProcessId und wenn wie find ich das handle vom explorer???
-
#include <windows.h> #include <tlhelp32.h> ... BOOL bOk=FALSE; HANDLE hSnapshot; PROCESSENTRY32 sData; hSnapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); sData.dwSize=sizeof(sData); if(!Process32First(hSnapshot,&sData))return FALSE; do { printf("\nName=%s\t%PID=%i",sData.szExeFile,sData.th32ProcessID); }while(Process32Next(hSnapshot,&sData)); CloseHandle(hSnapshot);