public bool TryRead(Reader reader, SerializationContext context, out Win32Api.POINT point)
            {
                var obj = Read(reader, null, context);

                if (obj == null)
                {
                    point = new Win32Api.POINT();
                    return(false);
                }
                point = (Win32Api.POINT)obj;
                return(true);
            }
        private static void thShowWaiting(object hObj)
        {
            TopWaiting hTopWaiting = (TopWaiting)hObj;

            CLDC_Comm.Win32Api.POINT CurPos = new Win32Api.POINT();
            if (CLDC_Comm.Win32Api.GetCursorPos(out CurPos))
            {
                //计算当前正在第几个屏幕
                System.Windows.Forms.Screen[] ArScreen = System.Windows.Forms.Screen.AllScreens;
                int index = Screen.GetScreenIndex(CurPos.X, CurPos.Y);
                //设置坐标
                Point PosLoc = new Point((ArScreen[index].WorkingArea.Width - hTopWaiting.Width) / 2, (ArScreen[index].WorkingArea.Height - hTopWaiting.Height) / 2);
                PosLoc.X            += ArScreen[index].WorkingArea.Left;
                PosLoc.Y            += ArScreen[index].WorkingArea.Top;
                hTopWaiting.Location = PosLoc;
            }
            hTopWaiting.ShowDialog();
        }
        private void Hook_MouseClickEvent(Win32Api.POINT point, Win32Api.MouseMessages msg)
        {
            var screenPoint = PointFromScreen(new Point(point.x, point.y));
            var result      = TreeHelper.TryFindFromPoint <Key>(this, screenPoint);
            var key         = result as Key;

            if (key == null)
            {
                return;
            }

            var keyCode = key.KeyCode;

            if (msg == Win32Api.MouseMessages.WM_LBUTTONDOWN)
            {
                _prevKey      = key;
                key.IsPressed = true;

                if (key.ClickMode == ClickMode.Press)
                {
                    key.RaiseEvent(new RoutedEventArgs(Key.ClickEvent));
                }
            }
            else if (msg == Win32Api.MouseMessages.WM_LBUTTONUP)
            {
                if (keyCode != VirtualKeyCode.CAPITAL && keyCode != VirtualKeyCode.SHIFT)
                {
                    if (_prevKey != null)
                    {
                        _prevKey.IsPressed = false;
                        _prevKey           = null;
                    }

                    key.IsPressed = false;
                }

                if (key.ClickMode == ClickMode.Release)
                {
                    key.RaiseEvent(new RoutedEventArgs(Key.ClickEvent));
                }
            }
        }