You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Thank you for this example, it helped me a lot.
After experimenting a bit, I think I found a better way of calculating the bounding rectangle of the non-client area in WM_NCCALCSIZE. Firstly, add the WS_MAXIMIZEBOX style flag to the window. This enables it to maximize when dragging it towards an edge of the monitor (size snapping), but it also makes the bottom of the window not get obscured by the taskbar. This makes the hacky solution with has_autohide_appbar unnecessary (the shell won't make it full-screen).
In my WM_NCCALCSIZE message, I then just do this:
autoconst parameters = reinterpret_cast<NCCALCSIZE_PARAMS*>(p_data_b);
if (IsMaximized(m_windowHandle)) {
auto info = MONITORINFO{};
info.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(MonitorFromRect(parameters->rgrc, MONITOR_DEFAULTTONEAREST), &info);
parameters->rgrc[0] = info.rcWork;
}
return0;
to properly fit the client area.
Hope this could help anyone.
The text was updated successfully, but these errors were encountered:
Hello! Thank you for this example, it helped me a lot.
After experimenting a bit, I think I found a better way of calculating the bounding rectangle of the non-client area in WM_NCCALCSIZE. Firstly, add the WS_MAXIMIZEBOX style flag to the window. This enables it to maximize when dragging it towards an edge of the monitor (size snapping), but it also makes the bottom of the window not get obscured by the taskbar. This makes the hacky solution with has_autohide_appbar unnecessary (the shell won't make it full-screen).
In my WM_NCCALCSIZE message, I then just do this:
to properly fit the client area.
Hope this could help anyone.
The text was updated successfully, but these errors were encountered: