Пример #1
0
        public clsMouse(IntPtr hWnd)
        {
            this._hWnd = hWnd;
            WC.GetWindowRect(hWnd, out this._rctWindow);
            WC.GetClientRect(hWnd, out this._rctClient);
            this._isFullWindowed = this._rctClient.Equals(this._rctWindow);
            if (WC.GetSystemMetrics(WC.SystemMetric.SM_SWAPBUTTON) == 0)
            {
                this._MOUSEEVENTF_PRIMARYDOWN   = 2;
                this._MOUSEEVENTF_PRIMARYUP     = 4;
                this._MOUSEEVENTF_SECONDARYDOWN = 8;
                this._MOUSEEVENTF_SECONDARYUP   = 0x10;
            }
            else
            {
                this._MOUSEEVENTF_PRIMARYDOWN   = 8;
                this._MOUSEEVENTF_PRIMARYUP     = 0x10;
                this._MOUSEEVENTF_SECONDARYDOWN = 2;
                this._MOUSEEVENTF_SECONDARYUP   = 4;
            }
            int x = this._rctWindow.Left + WC.GetSystemMetrics(WC.SystemMetric.SM_CXFRAME);
            int y = (this._rctWindow.Top + WC.GetSystemMetrics(WC.SystemMetric.SM_CYFRAME)) + WC.GetSystemMetrics(WC.SystemMetric.SM_CYCAPTION);

            this._clientRectStart = new Point(x, y);
        }