MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / GetProcessWindow

Function GetProcessWindow

emmy_tool/src/windows/utility.cpp:54–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54HWND GetProcessWindow(DWORD processId) {
55 HWND hWnd = FindWindowEx(nullptr, nullptr, nullptr, nullptr);
56
57 while (hWnd != nullptr) {
58 if (GetParent(hWnd) == nullptr && GetWindowTextLength(hWnd) > 0 && IsWindowVisible(hWnd)) {
59 DWORD windowProcessId;
60 GetWindowThreadProcessId(hWnd, &windowProcessId);
61
62 if (windowProcessId == processId) {
63 // Found a match.
64 break;
65 }
66 }
67 hWnd = GetWindow(hWnd, GW_HWNDNEXT);
68 }
69 return hWnd;
70}
71
72void GetProcesses(std::vector<Process>& processes) {
73 static char fileName[_MAX_PATH];

Callers 1

GetProcessesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected