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);
            }
        }
        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);
        }
Example #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);
        }
Example #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);
        }