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; } }
private static extern void DwmEnableBlurBehindWindow(IntPtr windowHandle, ref BlurBehindInformation blurBehindInformation);