As far as I am concerned, with DWM, It is necessary to recalculate the non-client area after the window is maximized. You can refer to the custom-chrome GitHub Project for more details.
The shadow around the window disappears when the window is maximized
As we all know, the window will occupy the whole screen when maximized in normal circumstances. However, I captured message "WM_GETMINMAXINFO" and modify window's rectangle size and position when maximizing the window, therefore it doesn't fill the entire screen.
Now here's the problem, the shadow around the window disappeared! I don't know if this is the default processing of windows system. If it is, how can I make the shadow reappear.
By the way, I add window shadow through DWM as follows:
DwmEnableComposition(DWM_EC_ENABLECOMPOSITION);
const MARGINS shadow = { 1, 0, 0, 0 };
DwmExtendFrameIntoClientArea(HWND(winId()), &shadow);
Could you please help me about this question? Thank you very much.
1 answer
Sort by: Most helpful
-
Xiaopo Yang - MSFT 12,726 Reputation points Microsoft Vendor
2021-06-23T09:45:14.003+00:00