[DllImport("dwmapi.dll", PreserveSig = true)]
public static extern int DwmSetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE attr, ref int attrValue, int attrSize);
<DllImport("dwmapi.dll", PreserveSig:=True)>
Public Shared Function DwmSetWindowAttribute(hwnd As IntPtr, attr As DWMWINDOWATTRIBUTE, ByRef attrValue As Integer, attrSize As Integer) As Integer
End Function
Use the DwmIsCompositionEnabled function to set the value of non-client rendering attributes for a window.