ep_dwm icon indicating copy to clipboard operation
ep_dwm copied to clipboard

Easiest way to disable rounded corners (no patching/adapter required)

Open limacohen opened this issue 2 years ago • 1 comments

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: "Disable round corners when window is snapped"

limacohen avatar Nov 30 '22 21:11 limacohen

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

Meneth32 avatar Aug 21 '24 13:08 Meneth32