public void AbortMoving()
{
// If currently trying to move the splitter
if (_moving)
{
// Exit the capturing state
_moving = false;
Captured = false;
// Remove the capturing of mouse input messages
if (_source.SeparatorControl.Capture)
_source.SeparatorControl.Capture = false;
// Remove the message filter, as long as it is registered
// it will prevent the class from being garbage collected.
UnregisterFilter();
// Remove any showing separator indicator
DrawSeparatorRemoved();
// Redraw the new state
UpdateTargetState(_source.SeparatorControl);
// Inform that the separator movement was finished without moving
_source.SeparatorNotMoved();
}
}
public bool PreFilterMessage(ref Message m) { // We are only interested in filtering when moving the separator if (!_controller.IsMoving) { return(false); } // We allow all non-keyboard messages if ((m.Msg < 0x100) || (m.Msg > 0x108)) { return(false); } // If the user presses the escape key, windows keys or any system key if (((m.Msg == 0x100) && (((int)m.WParam.ToInt64()) == 0x1B)) || ((m.Msg == 0x100) && (((int)m.WParam.ToInt64()) == 0x5B)) || (m.Msg == 0x104)) { _controller.AbortMoving(); } // We filter out all keyboard messages return(true); }