adjust_maximized_client_rect for me works fine when i minimize/maximize and restore window within my window, but problem appears when i hide (minimize) window using taskbar, and then again restore it with taskbar, size of the window still not fits correctly (it not fills hole monitor but a make size of my window a little larger ,and shift window down).
-
Not maximized window (normal)

-
Maximized window (by double clicking on nc area or my maximize button).

-
But when window maximized and minimized by taskbar and restore it fails.

And that happens on all sides of the window (i.e it little bigger that usual).
But when i resize taskbar, window again fits currently.

I try everything, send message WM_NCCALCSIZE, when message WM_SHOWWINDOW process, or manually move and change size of the window, but result still the same.
NOTE: In my window i use the same example as BordelessWindow only i change a little the HitTest, but that not causing this problem i've checked.
LRESULT HitTest(POINT p, HWND hwnd, bool handleResize) {
// identify borders and corners to allow resizing the window.
// Note: On Windows 10, windows behave differently and
// allow resizing outside the visible window frame.
// This implementation does not replicate that behavior.
const POINT border{
::GetSystemMetrics(SM_CXFRAME) + ::GetSystemMetrics(SM_CXPADDEDBORDER),
::GetSystemMetrics(SM_CYFRAME) + ::GetSystemMetrics(SM_CXPADDEDBORDER)
};
RECT window;
if (!::GetWindowRect(hwnd, &window)) {
return HTNOWHERE;
}
bool handleDragForClient = FE_FALSE;
bool handleDrag = FE_TRUE;
const auto drag = handleDrag ? HTCAPTION : HTCLIENT;
const auto dragClient = handleDragForClient ? HTCAPTION : HTCLIENT;
enum region_mask {
client = 0b0000,
left = 0b0001,
right = 0b0010,
top = 0b0100,
bottom = 0b1000,
};
const auto result = left * (p.x < (window.left + border.x)) |
right * (p.x >= (window.right - border.x)) |
top * (p.y < (window.top + border.y)) |
bottom * (p.y >= (window.bottom - border.y));
switch (result) {
case left: return handleResize ? HTLEFT : drag;
case right: return handleResize ? HTRIGHT : drag;
case top: return handleResize ? HTTOP : drag;
case bottom: return handleResize ? HTBOTTOM : drag;
case top | left: return handleResize ? HTTOPLEFT : drag;
case top | right: return handleResize ? HTTOPRIGHT : drag;
case bottom | left: return handleResize ? HTBOTTOMLEFT : drag;
case bottom | right: return handleResize ? HTBOTTOMRIGHT : drag;
case client: {
// Define the No Client Area Where we can drag. In this case is:
// 0 -- window.right - 117
// | |
// | |
// window.top + 40 -------
//
// NOTE: Client Area implement here using in Force Editor as PanelNonClientArea.
if (
// First rect.
p.x >= 0 && p.x <= window.right - 117 &&
p.y >= 0 && p.y <= window.top + 32 ||
// Second rect.
p.x >= (window.right / 2) + 100 && p.x <= window.right &&
p.y >= window.top + 32 && p.y <= window.top + 64
)
return HTCAPTION;
return dragClient;
}
default: return HTNOWHERE;
}
}
Edit 1: I look up to the #14 issue, it shoud fix my problem, but it didn't.
adjust_maximized_client_rect for me works fine when i minimize/maximize and restore window within my window, but problem appears when i hide (minimize) window using taskbar, and then again restore it with taskbar, size of the window still not fits correctly (it not fills hole monitor but a make size of my window a little larger ,and shift window down).
Not maximized window (normal)

Maximized window (by double clicking on nc area or my maximize button).

But when window maximized and minimized by taskbar and restore it fails.

And that happens on all sides of the window (i.e it little bigger that usual).
But when i resize taskbar, window again fits currently.

I try everything, send message WM_NCCALCSIZE, when message WM_SHOWWINDOW process, or manually move and change size of the window, but result still the same.
NOTE: In my window i use the same example as BordelessWindow only i change a little the HitTest, but that not causing this problem i've checked.
Edit 1: I look up to the #14 issue, it shoud fix my problem, but it didn't.