///////////////////////////////////////////////////////
| 578 | |
| 579 | //////////////////////////////////////////////////////////// |
| 580 | Vector2i WindowImplWin32::contentSizeToWindowSize(Vector2u size) |
| 581 | { |
| 582 | // SetWindowPos wants the total size of the window (including title bar, borders, and menu) so we have to compute it |
| 583 | const auto style = static_cast<DWORD>(GetWindowLongPtr(m_handle, GWL_STYLE)); |
| 584 | const BOOL hasMenu = ((style & WS_CHILD) == 0) && GetMenu(m_handle) != nullptr; |
| 585 | const auto exStyle = static_cast<DWORD>(GetWindowLongPtr(m_handle, GWL_EXSTYLE)); |
| 586 | |
| 587 | RECT rectangle = {0, 0, static_cast<long>(size.x), static_cast<long>(size.y)}; |
| 588 | AdjustWindowRectEx(&rectangle, style, hasMenu, exStyle); |
| 589 | const auto width = rectangle.right - rectangle.left; |
| 590 | const auto height = rectangle.bottom - rectangle.top; |
| 591 | |
| 592 | return {width, height}; |
| 593 | } |
| 594 | |
| 595 | |
| 596 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no outgoing calls
no test coverage detected