ep_dwm
ep_dwm copied to clipboard
Easiest way to disable rounded corners (no patching/adapter required)
I stumbled across this preference in PowerToys. If you just want to disable rounded corners and you don't mind using FancyZones, this is by far the easiest (official?) way to do it:
Windows 11 rounded corners can be disabled, per-window, by calling DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, DWMWCP_DONOTROUND); (paraphrased). See: https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwm_window_corner_preference The remaining trick is calling this function on every window created by other processes before they're shown. PowerToys' implementation of the core call can be found here: https://github.com/microsoft/PowerToys/blob/main/src/modules/fancyzones/FancyZonesLib/WindowUtils.cpp