Use DwmSetWindowAttribute to create rounded-corner window but didn't work
See the question and my original answer on StackOverflowYou say you're using Windows 10, but DWMWA_WINDOW_CORNER_PREFERENCE is supported only starting with Windows 11 Build 22000 as official doc says:
DWMWA_WINDOW_CORNER_PREFERENCEUse withDwmSetWindowAttribute. Specifies the rounded corner preference for a window. ThepvAttributeparameter points to a value of typeDWM_WINDOW_CORNER_PREFERENCE.This value is supported starting with Windows 11 Build 22000.