internal static void SetNonClientRenderingPolicy(this Window window, NonClientRenderingPolicy policy) { Contract.Requires(window != null); //Contract.Requires(Enum.IsDefined(typeof(NonClientRenderingPolicy), policy)); var handle = window.GetWin32Handle(); const int attr = (int)WindowAttribute.NonClientRenderingPolicy; var value = (int)policy; const int size = sizeof(int); var result = UnsafeNativeMethods.DwmSetWindowAttribute(handle, attr, ref value, size); Win32Error.EnsureSuccess(result); }
/// <summary> /// Sets the rendering policy of the non client area of the form /// </summary> /// <param name="policy">Non client rendering policy</param> public void SetNonClientRenderingPolicy(NonClientRenderingPolicy policy) { int value = (int)policy; SetIntValue(WindowAttribute.NcRenderingPolicy, ref value); }
/// <summary> /// Sets the rendering policy of the non client area of the form /// </summary> /// <param name="policy">Non client rendering policy</param> public void SetNonClientRenderingPolicy(NonClientRenderingPolicy policy) { int value = (int)policy; SetIntValue(WindowAttribute.NcRenderingPolicy, ref value); }