Exemplo n.º 1
0
 public static bool IsCompositionEnabled()
 {
     try
     {
         return(DwmApi.DwmIsCompositionEnabled());
     }
     catch (DllNotFoundException)
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 public static void EnableBlurBehindWindow(IntPtr windowHandle, bool enable)
 {
     try
     {
         if (DwmApi.DwmIsCompositionEnabled())
         {
             BlurBehindInformation BlurBehindInformation = new BlurBehindInformation(enable, IntPtr.Zero);
             DwmApi.DwmEnableBlurBehindWindow(windowHandle, ref BlurBehindInformation);
             return;
         }
         else
         {
             //Glass effect is not enabled -> do nothing
             return;
         }
     }
     catch (DllNotFoundException)
     {
         return;
     }
 }
Exemplo n.º 3
0
        internal static void EnableGlassEffect(IntPtr windowHandle, Margins margins)
        {
            try
            {
                if (DwmApi.DwmIsCompositionEnabled())
                {
                    IntPtr Handle = windowHandle;

                    DwmApi.DwmExtendFrameIntoClientArea(Handle, ref margins);
                    return;
                }
                else
                {
                    //Glass effect is not enabled -> do nothing
                    return;
                }
            }
            catch (DllNotFoundException)
            {
                return;
            }
        }