#ifndef __MOUSE_ASSIST__
#define __MOUSE_ASSIST__

#pragma once

// 坐标点类型;
enum PT_TYPE
{
	SCREEN_POINT,		// 屏幕模式,点是基于屏幕的;
	WINDOW_POINT		// 窗口模式,点是基于窗口的;
};

class MouseAssist
{
public:
	MouseAssist();
	~MouseAssist();

private:
	// 关联的进程窗口句柄;
	HWND _hWnd;
	// 鼠标是前台模式，还是后台模式;
	int _nMode;
	// 当前点;
	POINT _curpt;
public:
	void BindWnd(HWND hWnd, int nMode);
	void UnBindWnd();
	// 获取当前鼠标位置;
	BOOL GetCursorPos();
	BOOL GetCursorPos(long &x, long &y);
	BOOL SetCursorPos(long x, long y);

	// 移动到指定点;注意：点坐标是窗口;
	inline BOOL MoveTo(int x, int y);
	// 在指定范围内随机移动;
	BOOL MoveToEx(int x, int y, int w, int h);

	BOOL LeftDoubleClick();
	inline BOOL LeftClick();	
	inline BOOL LeftDown();
	inline BOOL LeftUp();

	BOOL MiddleClick();
	inline BOOL MiddleDown();
	inline BOOL MiddleUp();

	BOOL RightClick();
	inline BOOL RightDown();
	inline BOOL RightUp();

	inline BOOL WheelDown();
	inline BOOL WheelUp();
};


#endif