MCPcopy Create free account
hub / github.com/WallBreaker2/op / find_process_name

Function find_process_name

libop/window/WindowProcess.cpp:47–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47std::wstring find_process_name(DWORD pid) {
48 PROCESSENTRY32 pe32 = {sizeof(PROCESSENTRY32)};
49 op::win32::unique_handle process_snapshot(::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));
50 if (!process_snapshot)
51 return L"";
52
53 if (::Process32First(process_snapshot.get(), &pe32)) {
54 do {
55 if (pe32.th32ProcessID == pid)
56 return pe32.szExeFile;
57 } while (::Process32Next(process_snapshot.get(), &pe32));
58 }
59
60 return L"";
61}
62
63} // namespace
64

Callers 1

GetProcessInfoMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected