setWindowRoundedCorners method
Sets this Window rounded corners attributes.
- If
rounded
istrue
will set this Window with rounded corners, otherwise will disable the rounded corners. - If
small
istrue
round the corners with a small radius.
Implementation
void setWindowRoundedCorners({bool rounded = true, bool small = false}) {
final pref = calloc<DWORD>();
try {
final hwnd = this.hwnd;
pref.value = rounded
? (small
? DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUNDSMALL
: DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND)
: DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DONOTROUND;
DwmSetWindowAttribute(
hwnd,
DWMWINDOWATTRIBUTE.DWMWA_WINDOW_CORNER_PREFERENCE,
pref,
sizeOf<DWORD>(),
);
} finally {
free(pref);
}
}