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