| 42 | }; |
| 43 | |
| 44 | processdata GetProcessData(DWORD proc) { |
| 45 | char szProcessName[MAX_PATH]{ 0 }; |
| 46 | HANDLE hProcess; |
| 47 | processdata res; |
| 48 | if (hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, proc)) { |
| 49 | if (GetModuleFileNameEx(hProcess, NULL, szProcessName, MAX_PATH)) { |
| 50 | string procName = string(szProcessName); |
| 51 | res.appName = procName.substr(procName.find_last_of('\\') + 1); |
| 52 | res.appPath = procName.substr(0, procName.length() - res.appName.length()); |
| 53 | } |
| 54 | CloseHandle(hProcess); |
| 55 | } |
| 56 | return res; |
| 57 | } |
| 58 | |
| 59 | processdata GetProcessData(HWND hwnd) { |
| 60 | DWORD prcId; |
no outgoing calls
no test coverage detected