MCPcopy Create free account
hub / github.com/baldurk/renderdoc / fillWindowTitles

Function fillWindowTitles

qrenderdoc/Code/qprocessinfo.cpp:38–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36};
37
38static BOOL CALLBACK fillWindowTitles(HWND hwnd, LPARAM lp)
39{
40 callbackContext *ctx = (callbackContext *)lp;
41
42 DWORD pid = 0;
43 ctx->GetWindowThreadProcessId(hwnd, &pid);
44
45 HWND parent = ctx->GetWindow(hwnd, GW_OWNER);
46
47 if(parent != 0)
48 return TRUE;
49
50 if(!ctx->IsWindowVisible(hwnd))
51 return TRUE;
52
53 for(QProcessInfo &info : ctx->list)
54 {
55 if(info.pid() == (uint32_t)pid)
56 {
57 int len = ctx->GetWindowTextLengthW(hwnd);
58 wchar_t *buf = new wchar_t[len + 1];
59 ctx->GetWindowTextW(hwnd, buf, len + 1);
60 buf[len] = 0;
61 info.setWindowTitle(QString::fromStdWString(std::wstring(buf)));
62 delete[] buf;
63 return TRUE;
64 }
65 }
66
67 return TRUE;
68}
69
70QProcessList QProcessInfo::enumerate(bool includeWindowTitles)
71{

Callers

nothing calls this directly

Calls 3

GetWindowMethod · 0.80
setWindowTitleMethod · 0.80
pidMethod · 0.45

Tested by

no test coverage detected