I have a custom-made borderless window. When maximized, it covers the taskbar. This is not what I want. I have played with the WM_GETMINMAXINFO
message. But, I have found that Windows 10 will then leave an extra 8-pixel gap along both the bottom and right side. It is an all-or-nothing proposition. Here is the first code that I tried:
case WM_GETMINMAXINFO:
PMINMAXINFO pmm;
pmm = (PMINMAXINFO)lParam;
pmm->ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN);
pmm->ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN);
return 0;
The result of this is identical to what I had, without hooking the WM_GETMINMAXINFO
message. So, I knocked two pixels off of the bottom, so I could access the taskbar (which is in "autohide" mode":
case WM_GETMINMAXINFO:
PMINMAXINFO pmm;
pmm = (PMINMAXINFO)lParam;
pmm->ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN);
pmm->ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN)-2;
return 0;
Suddenly, I have a 10-pixel gap on the bottom, and a new 8-pixel gap on the right side! this appears to be a Windows 10 thing, as this never happened with Win7. I have also tried SystemParametersInfo
, calling SPI_GETWORKAREA
(instead of GetSystemMetrics()
). This yields the same results.
From what I gather, the problem is not with WM_GETMINMAXINFO
. Instead, I need to put a command into my code, to keep the taskbar on top. I have searched through the windows styles. But, I have found nothing of help there.
Does anyone know how to fix this critical problem.
WM_WINDOWPOSCHANGING
and adjusting the window size there? The documentation behind the link tells you how. – Paul SandersDwmGetWindowAttribute
with theDWMWA_EXTENDED_FRAME_BOUNDS
flag. – Jonathan Potter