| 7 | namespace p2c::win |
| 8 | { |
| 9 | gfx::RectI GetWindowClientRect(HWND hWnd) |
| 10 | { |
| 11 | RECT cr; |
| 12 | if (!GetClientRect(hWnd, &cr)) |
| 13 | { |
| 14 | pmlog_warn().hr(); |
| 15 | return { 0,0,0,0 }; |
| 16 | } |
| 17 | POINT tl{ 0, 0 }; |
| 18 | if (!ClientToScreen(hWnd, &tl)) |
| 19 | { |
| 20 | pmlog_warn().hr(); |
| 21 | return { 0,0,0,0 }; |
| 22 | } |
| 23 | return { tl.x, tl.y, tl.x + cr.right, tl.y + cr.bottom }; |
| 24 | } |
| 25 | |
| 26 | std::wstring GetWindowTitle(HWND hWnd) |
| 27 | { |