| 39 | } |
| 40 | |
| 41 | CString 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 | |
| 71 | CString WindowHelper::WindowExtendedStyleToString(HWND hWnd) { |
| 72 | auto style = CWindow(hWnd).GetExStyle(); |