Ejemplo n.º 1
0
        private void InitializeAeroGlass()
        {
            ResetDwmBlurBehind();
            m_glassMargins = new DwmApi.MARGINS(-1, -1, -1, -1);
            //m_glassMargins = new DwmApi.MARGINS(1, 1, 1, 1);

            if (DwmApi.DwmIsCompositionEnabled())
            {
                DwmApi.DwmExtendFrameIntoClientArea(this.Handle, m_glassMargins);
            }
        }
Ejemplo n.º 2
0
        protected override void WndProc(ref Message m)
        {
            const int WM_DWMCOMPOSITIONCHANGED = 0x031E;

            switch (m.Msg)
            {
            case 0x0084:
                IntPtr currentActiveHandle = NativeMethods.GetForegroundWindow();
                if (NativeMethods.IsWindow(currentActiveHandle) && currentActiveHandle != this.Handle)
                {
                    lastActiveHandle = currentActiveHandle;
                }
                break;

            case 0x0021:
                int hitTestResult = (int)m.LParam & 0xff;

                // hit client
                if (hitTestResult == 1)
                {
                    m.Result = new IntPtr(3);
                    return;
                }
                break;

            case WM_DWMCOMPOSITIONCHANGED:
                if (!DwmApi.DwmIsCompositionEnabled())
                {
                    m_glassMargins = null;
                }
                else
                {
                    InitializeAeroGlass();
                }
                break;
            }
            base.WndProc(ref m);
        }
Ejemplo n.º 3
0
        private void InitializeAeroGlass()
        {
            ResetDwmBlurBehind();
            m_glassMargins = new DwmApi.MARGINS(-1, -1, -1, -1);
            //m_glassMargins = new DwmApi.MARGINS(1, 1, 1, 1);

            if (DwmApi.DwmIsCompositionEnabled()) DwmApi.DwmExtendFrameIntoClientArea(this.Handle, m_glassMargins);
        }
Ejemplo n.º 4
0
        protected override void WndProc(ref Message m)
        {
            const int WM_DWMCOMPOSITIONCHANGED = 0x031E;

            switch (m.Msg)
            {
                case 0x0084:
                    IntPtr currentActiveHandle = NativeMethods.GetForegroundWindow();
                    if (NativeMethods.IsWindow(currentActiveHandle) && currentActiveHandle != this.Handle)
                    {
                        lastActiveHandle = currentActiveHandle;
                    }
                    break;
                case 0x0021:
                    int hitTestResult = (int)m.LParam & 0xff;

                    // hit client
                    if (hitTestResult == 1)
                    {
                        m.Result = new IntPtr(3);
                        return;
                    }
                    break;
                case WM_DWMCOMPOSITIONCHANGED:
                    if (!DwmApi.DwmIsCompositionEnabled())
                    {
                        m_glassMargins = null;
                    }
                    else
                    {
                        InitializeAeroGlass();
                    }
                    break;
            }
            base.WndProc(ref m);
        }