MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / ClassStyleToString

Method ClassStyleToString

WinArk/WindowHelper.cpp:41–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41CString WindowHelper::ClassStyleToString(HWND hWnd) {
42 auto style = ::GetClassLongPtr(hWnd, GCL_STYLE);
43 CString text;
44
45 static struct {
46 DWORD style;
47 PCWSTR text;
48 } styles[] = {
49 { CS_HREDRAW , L"HREDRAW" },
50 { CS_VREDRAW , L"VREDRAW" },
51 { CS_DBLCLKS , L"DBLCLKS" },
52 { CS_OWNDC , L"OWNDC" },
53 { CS_CLASSDC , L"CLASSDC" },
54 { CS_PARENTDC , L"PARENTDC" },
55 { CS_SAVEBITS , L"SAVEBITS" },
56 { CS_GLOBALCLASS , L"GLOBALCLASS" },
57 { CS_BYTEALIGNCLIENT , L"BYTEALIGNCLIENT" },
58 { CS_BYTEALIGNWINDOW , L"BYTEALIGWINDOW" },
59 };
60
61 for (auto& item : styles) {
62 if (style & item.style)
63 text += CString(item.text) += L", ";
64 }
65 if (text.IsEmpty())
66 return L"";
67
68 return L"(CS_) " + text.Left(text.GetLength() - 2);
69}
70
71CString WindowHelper::WindowExtendedStyleToString(HWND hWnd) {
72 auto style = CWindow(hWnd).GetExStyle();

Callers

nothing calls this directly

Calls 2

IsEmptyMethod · 0.80
GetLengthMethod · 0.45

Tested by

no test coverage detected