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

Function WindowClassNameText

libop/window/WindowService.cpp:23–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21};
22
23WindowTextValue WindowClassNameText(HWND hwnd) {
24 std::vector<wchar_t> buffer(256, L'\0');
25 for (;;) {
26 const int copied = ::GetClassNameW(hwnd, buffer.data(), static_cast<int>(buffer.size()));
27 if (copied <= 0)
28 return WindowTextValue();
29 if (static_cast<size_t>(copied) < buffer.size() - 1)
30 return WindowTextValue(std::wstring(buffer.data(), static_cast<size_t>(copied)));
31 buffer.assign(buffer.size() * 2, L'\0');
32 }
33}
34
35WindowTextValue WindowTitleText(HWND hwnd) {
36 const int length = ::GetWindowTextLengthW(hwnd);

Callers 3

FindChildWndMethod · 0.85
EnumWindowInternalMethod · 0.85
FindWindowByProcessMethod · 0.85

Calls 3

WindowTextValueClass · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected