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);
        }
        // thanks to http://www.blizzhackers.cc/viewtopic.php?p=4584495#p4584495 and Opkllhibus
        public static PointF FromD3toScreenCoords(Vec3 vec3)
        {
            RECT rect;

            WC.GetClientRect(Globals.winHandle, out rect);
            int resolutionX = rect.Width;
            int resolutionY = rect.Height;

            return(FromD3toScreenCoords(vec3, resolutionX, resolutionY));
        }
        public static SmartClicker GetInstance(IntPtr hwnd)
        {
            WC.GetClientRect(hwnd, out ClientRect);
            if (!WC.IsFullScreen(hwnd))
            {
                return(null);
            }
            ScreenSize size = (ScreenSize)Enum.Parse(typeof(ScreenSize), string.Concat(new object[] { "Size", ClientRect.Width, "x", ClientRect.Height }));

            return(GetInstance(hwnd, size));
        }
 public static ScreenSize CurrentSize(IntPtr hwnd)
 {
     WC.GetClientRect(hwnd, out ClientRect);
     try
     {
         return((ScreenSize)Enum.Parse(typeof(ScreenSize), string.Concat(new object[] { "Size", ClientRect.Width, "x", ClientRect.Height })));
     }
     catch
     {
         return(ScreenSize.SizeUnknown);
     }
 }
 public static bool IsSupported(IntPtr hwnd)
 {
     WC.GetClientRect(hwnd, out ClientRect);
     try
     {
         ScreenSize item = (ScreenSize)Enum.Parse(typeof(ScreenSize), string.Concat(new object[] { "Size", ClientRect.Width, "x", ClientRect.Height }));
         return(Utility.supported.Contains(item));
     }
     catch
     {
         return(false);
     }
 }