public ShapedForm() { if (dllWrapper == null) { dllWrapper = new DllWrapper(@"dwmapi.dll"); if (dllWrapper.IsDllLoaded) { dwmIsCompositionEnabled = (DwmIsCompositionEnabled)dllWrapper.GetFunctionAsDelegate( "DwmIsCompositionEnabled", typeof(DwmIsCompositionEnabled)); if (dwmIsCompositionEnabled != null) { bool enabled = false; dwmIsCompositionEnabled(ref enabled); if (enabled) { dwmEnableBlurBehindWindow = (DwmEnableBlurBehindWindow)dllWrapper.GetFunctionAsDelegate( "DwmEnableBlurBehindWindow", typeof(DwmEnableBlurBehindWindow)); isCompositionAvailable = true; } } } } InitializeComponent(); }
/// <summary> /// Creates an instance of the <typeparamref name="RadRibbonFormBehavior"/> class. /// </summary> /// <param name="treeHandler">The associated <typeparamref name="IComponentTreeHandler"/> implementation.</param> /// <param name="shouldHandleCreateChildItems">Determines whether the behavior /// handles the CreateChildItems call.</param> public RadRibbonFormBehavior(IComponentTreeHandler treeHandler, bool shouldHandleCreateChildItems) : base(treeHandler, shouldHandleCreateChildItems) { DllWrapper dwmapi = new DllWrapper("dwmapi.dll"); DwmExtendFrameIntoClientArea = (DwmExtendFrameIntoClientAreaDelegate)dwmapi.GetFunctionAsDelegate("DwmExtendFrameIntoClientArea", typeof(DwmExtendFrameIntoClientAreaDelegate)); DwmDefWindowProc = (DwmDefWindowProcDelegate)dwmapi.GetFunctionAsDelegate("DwmDefWindowProc", typeof(DwmDefWindowProcDelegate)); }
/// <summary> /// Creates an instance of the <typeparamref name="RadRibbonFormBehavior"/> class. /// This instance is not associated with an <typeparamref name="IComponentTreeHandler"/> implementation. /// </summary> public RadRibbonFormBehavior() : base() { DllWrapper dwmapi = new DllWrapper("dwmapi.dll"); DwmExtendFrameIntoClientArea = (DwmExtendFrameIntoClientAreaDelegate)dwmapi.GetFunctionAsDelegate("DwmExtendFrameIntoClientArea", typeof(DwmExtendFrameIntoClientAreaDelegate)); DwmDefWindowProc = (DwmDefWindowProcDelegate)dwmapi.GetFunctionAsDelegate("DwmDefWindowProc", typeof(DwmDefWindowProcDelegate)); }