SetWindowThemeAttribute

[DllImport("uxtheme.dll", SetLastError = true)]
public static extern HRESULT SetWindowThemeAttribute(
   HWND hwnd,
   WINDOWTHEMEATTRIBUTETYPE eAttribute,
   IntPtr pvAttribute,
   uint cbAttribute
);

Microsoft documentation: Link

Last updated