Exemplo n.º 1
0
        protected virtual void OnCompositionChanged(CompositionChangedEventArgs e)
        {
            if (this.AutoHandleMessagesStyle.HasFlags(Messages.CompositionChanged))
            {
                if (this.UseAeroGlassComposition && IsDwmSupported && e.Enabled)
                {
                    this.UseAeroGlassCompositionCore = true;
                }
                if (this.UseTransparencyKey)
                {
                    if (this.UseAeroGlassComposition)
                    {
                        this.UseTransparencyKeyCore = e.Enabled;
                    }
                    else if (!e.Enabled)
                    {
                        Message m;

                        m = Message.Create(this.Handle, (int)Win32Constants.WM.NCACTIVATE, this.IsActiveWParam, IntPtr.Zero);
                        this.WndProc(ref m);
                        //this.DefWndProc(ref m);
                        //Win32Methods.CallWindowProc(Win32Methods.GetWindowLong(new HandleRef(this, this.Handle), -4),
                        //                            this.Handle,
                        //                            (int)Win32Constants.WM.NCACTIVATE,
                        //                            this.IsActiveWParam,
                        //                            IntPtr.Zero);
                        //Win32Methods.DefWindowProc(this.Handle, (int)Win32Constants.WM.NCACTIVATE, this.IsActiveWParam, IntPtr.Zero);
                    }
                }
            }
            this.RaiseCompositionChanged(e);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Raises the 'CompositionChanged' event.
        /// </summary>
        /// <param name="e">
        /// The event args to use when raising the event
        /// </param>
        protected void RaiseCompositionChanged(CompositionChangedEventArgs e)
        {
            CompositionChangedEventHandler eh;

            eh = (CompositionChangedEventHandler)this.Events[EventHandlerKeyComposition];
            if (eh != null)
            {
                eh(this, e);
            }
        }