private static void HandleMouseButtonUp(NMouseButton mouseButton, Win32Window window, Win32MessageType messageType, uint wParam, uint lParam) { int x = (short)(lParam & 0xFFFF); int y = (short)((lParam >> 16) & 0xFFFF); if (!AnyMouseButtonIsDown()) { Win32API.ReleaseCapture(); } window.StartupInfo.OnMouseButtonUp(mouseButton, new Point(x, y)); }