Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
 /// <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);
 }