Exemplo n.º 1
0
        public bool PressTrackedControl(IntPtr lParam)
        {
            var controlUnderMouse = this.GetControlUnderMouse(lParam);

            if (controlUnderMouse != this.trackedControl)
            {
                this.HoverTrackedControl(lParam);
            }

            if (this.trackedControl is null)
            {
                return(false);
            }

            NonClientControlProperties.SetIsNCPressed(this.trackedControl, true);

            var nonClientControlClickStrategy = NonClientControlProperties.GetClickStrategy(this.trackedControl);

            if (nonClientControlClickStrategy is NonClientControlClickStrategy.MouseEvent)
            {
                // Raising LBUTTONDOWN here automatically causes a LBUTTONUP to be raised by windows later correctly
                PInvoke.RaiseMouseMessage(this.OwnerHandle, WM.LBUTTONDOWN, default, lParam);