Quellcode durchsuchen

新建命名空间,单独的按键和鼠标处理。

Jeff vor 4 Jahren
Ursprung
Commit
9f5c581c59

+ 264 - 0
GameAssist/GameAssist/Assist.cpp

@@ -1245,3 +1245,267 @@ namespace GAssist
 	}
 
 }
+
+namespace GameAssist {
+	void SetGameForeground(HWND hWnd)
+	{
+		if (!IsWindow(hWnd))
+			return;
+
+		::ShowWindow(hWnd, SW_SHOWNORMAL);
+		::SetForegroundWindow(hWnd); // 窗口前置才能单击成功;
+	}
+
+	BOOL GamePos2Screen(HWND hWnd, POINT& pt, bool bOffset)
+	{
+		if (!::IsWindow(hWnd)) return FALSE;
+		if (bOffset) {
+			pt = { pt.x - 2, pt.y - 27 };
+		}
+		return ClientToScreen(hWnd, &pt);
+	}
+
+	BOOL ScreenPos2Game(HWND hWnd, POINT& pt)
+	{
+		if (!::IsWindow(hWnd)) return FALSE;
+		return ScreenToClient(hWnd, &pt);
+	}
+
+	void MouseMove(POINT pt, bool bSetCurPos)
+	{
+		static long fScreenWidth = ::GetSystemMetrics(SM_CXSCREEN) - 1;
+		static long fScreenHeight = ::GetSystemMetrics(SM_CYSCREEN) - 1;
+		double fx = (double)pt.x * (65535.0f / fScreenWidth);
+		double fy = (double)pt.y * (65535.0f / fScreenHeight);
+#if 1 // mouse_event处理
+		// MOUSEEVENTF_ABSOLUTE 使用绝对鼠标位置;
+		mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, fx, fy, 0, 0);
+#else // setinput处理;
+		INPUT Input = { 0 };
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
+		Input.mi.dx = static_cast<LONG>(fx);
+		Input.mi.dy = static_cast<LONG>(fy);
+		::SendInput(1, &Input, sizeof(INPUT));
+#endif
+		// Move之后要单击,必须setpos;
+		if (bSetCurPos)::SetCursorPos(pt.x, pt.y);
+	}
+
+	void MouseClick()
+	{
+		POINT pt;
+		::GetCursorPos(&pt);
+#if 0
+		// 建议使用这种方式,可以看到鼠标;
+		::SetCursorPos(pt.x, pt.y); // 必须将鼠标定位到目标单击点;
+		mouse_event(MOUSEEVENTF_LEFTDOWN, pt.x, pt.y, 0, 0);
+		Sleep(10);
+		mouse_event(MOUSEEVENTF_LEFTUP, pt.x, pt.y, 0, 0);
+#else
+		INPUT Input = { 0 };
+		Input.type = INPUT_MOUSE;
+		Input.mi.dx = pt.x;
+		Input.mi.dy = pt.y;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		//::ZeroMemory(&Input, sizeof(INPUT));
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
+		::SendInput(1, &Input, sizeof(INPUT));
+#endif
+	}
+
+	void MouseClick(POINT pt)
+	{
+		MouseMove(pt);
+#if 0
+		// 建议使用这种方式,可以看到鼠标;
+		::SetCursorPos(pt.x, pt.y); // 必须将鼠标定位到目标单击点;
+		mouse_event(MOUSEEVENTF_LEFTDOWN, pt.x, pt.y, 0, 0);
+		Sleep(10);
+		mouse_event(MOUSEEVENTF_LEFTUP, pt.x, pt.y, 0, 0);
+#else
+		INPUT Input = { 0 };
+		Input.type = INPUT_MOUSE;
+		Input.mi.dx = pt.x;
+		Input.mi.dy = pt.y;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		//::ZeroMemory(&Input, sizeof(INPUT));
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
+		::SendInput(1, &Input, sizeof(INPUT));
+#endif
+	}
+
+	void MouseDbClick()
+	{
+		POINT pt;
+		::GetCursorPos(&pt);
+#if 0
+		// 建议使用这种方式,可以看到鼠标;
+		::SetCursorPos(pt.x, pt.y); // 必须将鼠标定位到目标单击点;
+		mouse_event(MOUSEEVENTF_LEFTDOWN, pt.x, pt.y, 0, 0);
+		mouse_event(MOUSEEVENTF_LEFTUP, pt.x, pt.y, 0, 0);
+		mouse_event(MOUSEEVENTF_LEFTDOWN, pt.x, pt.y, 0, 0);
+		mouse_event(MOUSEEVENTF_LEFTUP, pt.x, pt.y, 0, 0);
+#else
+		INPUT Input = { 0 };
+		Input.type = INPUT_MOUSE;
+		Input.mi.dx = pt.x;
+		Input.mi.dy = pt.y;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		//::ZeroMemory(&Input, sizeof(INPUT));
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
+		::SendInput(1, &Input, sizeof(INPUT));
+#endif
+	}
+
+	void MouseDbClick(POINT pt)
+	{
+		MouseMove(pt);
+#if 0
+		// 建议使用这种方式,可以看到鼠标;
+		::SetCursorPos(pt.x, pt.y); // 必须将鼠标定位到目标单击点;
+		mouse_event(MOUSEEVENTF_LEFTDOWN, pt.x, pt.y, 0, 0);
+		mouse_event(MOUSEEVENTF_LEFTUP, pt.x, pt.y, 0, 0);
+		mouse_event(MOUSEEVENTF_LEFTDOWN, pt.x, pt.y, 0, 0);
+		mouse_event(MOUSEEVENTF_LEFTUP, pt.x, pt.y, 0, 0);
+#else
+		INPUT Input = { 0 };
+		Input.type = INPUT_MOUSE;
+		Input.mi.dx = pt.x;
+		Input.mi.dy = pt.y;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		//::ZeroMemory(&Input, sizeof(INPUT));
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
+		::SendInput(1, &Input, sizeof(INPUT));
+#endif
+	}
+
+	void MouseRClick()
+	{
+		POINT pt;
+		::GetCursorPos(&pt);
+#if 0
+		// 建议使用这种方式,可以看到鼠标;
+		::SetCursorPos(pt.x, pt.y); // 必须将鼠标定位到目标单击点;
+		mouse_event(MOUSEEVENTF_RIGHTDOWN, pt.x, pt.y, 0, 0);
+		Sleep(10);
+		mouse_event(MOUSEEVENTF_RIGHTUP, pt.x, pt.y, 0, 0);
+#else
+		INPUT Input = { 0 };
+		Input.type = INPUT_MOUSE;
+		Input.mi.dx = pt.x;
+		Input.mi.dy = pt.y;
+		Input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		//::ZeroMemory(&Input, sizeof(INPUT));
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_RIGHTUP;
+		::SendInput(1, &Input, sizeof(INPUT));
+#endif
+	}
+
+	void MouseRClick(POINT pt)
+	{
+		MouseMove(pt);
+#if 0
+		// 建议使用这种方式,可以看到鼠标;
+		::SetCursorPos(pt.x, pt.y); // 必须将鼠标定位到目标单击点;
+		mouse_event(MOUSEEVENTF_RIGHTDOWN, pt.x, pt.y, 0, 0);
+		Sleep(10);
+		mouse_event(MOUSEEVENTF_RIGHTUP, pt.x, pt.y, 0, 0);
+#else
+		INPUT Input = { 0 };
+		Input.type = INPUT_MOUSE;
+		Input.mi.dx = pt.x;
+		Input.mi.dy = pt.y;
+		Input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		//::ZeroMemory(&Input, sizeof(INPUT));
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_RIGHTUP;
+		::SendInput(1, &Input, sizeof(INPUT));
+#endif
+	}
+
+	void MouseDrag(POINT pt)
+	{
+#if 0
+		// 建议使用这种方式,可以看到鼠标;
+		::SetCursorPos(pt.x, pt.y); // 必须将鼠标定位到目标单击点;
+		mouse_event(MOUSEEVENTF_LEFTDOWN, pt.x, pt.y, 0, 0);
+		Sleep(10);
+		MouseMove(pt, false);
+		Sleep(30);
+		mouse_event(MOUSEEVENTF_LEFTUP, pt.x, pt.y, 0, 0);
+#else
+		INPUT Input = { 0 };
+		Input.type = INPUT_MOUSE;
+		Input.mi.dx = pt.x;
+		Input.mi.dy = pt.y;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
+		::SendInput(1, &Input, sizeof(INPUT));
+
+		Sleep(10);
+		MouseMove(pt, false);
+		Sleep(30);
+		//::ZeroMemory(&Input, sizeof(INPUT));
+		Input.type = INPUT_MOUSE;
+		Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
+		::SendInput(1, &Input, sizeof(INPUT));
+#endif
+	}
+
+	void SendKey(DWORD key, BOOL bCtrl, BOOL bAtl, BOOL bShift)
+	{
+		if (bCtrl)
+			keybd_event(VK_CONTROL, 0x1D, KEYEVENTF_EXTENDEDKEY | 0, 0);
+		if (bAtl)
+			keybd_event(VK_MENU, 0, KEYEVENTF_EXTENDEDKEY | 0, 0);
+		if (bShift)
+			keybd_event(VK_SHIFT, 0x2A, KEYEVENTF_EXTENDEDKEY | 0, 0);
+
+		Sleep(120);	// 注意:有些电脑能响应Ctrl+V,有些不行,则需要加大CTRL与V之间的时间间隔;
+		// key down;
+		keybd_event(key, 0, KEYEVENTF_EXTENDEDKEY | 0, 0);
+		// key up;
+		keybd_event(key, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+
+		Sleep(120);
+		if (bCtrl)
+			keybd_event(VK_CONTROL, 0x1D, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+		if (bAtl)
+			keybd_event(VK_MENU, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+		if (bShift)
+			keybd_event(VK_SHIFT, 0x2A, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+	}
+};

+ 29 - 69
GameAssist/GameAssist/Assist.h

@@ -6,75 +6,6 @@
 #include <map>
 #include <string>
 
-
-//定义数据字符0~9
-#define   VK_0         0x30 
-#define   VK_1         0x31 
-#define   VK_2         0x32 
-#define   VK_3         0x33 
-#define   VK_4         0x34 
-#define   VK_5         0x35 
-#define   VK_6         0x36 
-#define   VK_7         0x37 
-#define   VK_8         0x38 
-#define   VK_9         0x39
-
-//定义数据字符A~Z
-#define   VK_A	0x41 
-#define   VK_B	0x42 
-#define   VK_C	0x43 
-#define   VK_D	0x44 
-#define   VK_E	0x45 
-#define   VK_F	0x46 
-#define   VK_G	0x47 
-#define   VK_H	0x48 
-#define   VK_I	0x49 
-#define   VK_J	0x4A 
-#define   VK_K	0x4B 
-#define   VK_L	0x4C 
-#define   VK_M	0x4D 
-#define   VK_N	0x4E 
-#define   VK_O	0x4F 
-#define   VK_P	0x50 
-#define   VK_Q	0x51 
-#define   VK_R	0x52 
-#define   VK_S	0x53 
-#define   VK_T	0x54 
-#define   VK_U	0x55 
-#define   VK_V	0x56 
-#define   VK_W	0x57 
-#define   VK_X	0x58 
-#define   VK_Y	0x59 
-#define   VK_Z	0x5A 
-
-//定义数据字符a~z
-#define   VK_a	0x61 
-#define   VK_b	0x62 
-#define   VK_c	0x63 
-#define   VK_d	0x64 
-#define   VK_e	0x65 
-#define   VK_f	0x66 
-#define   VK_g	0x67 
-#define   VK_h	0x68 
-#define   VK_i	0x69 
-#define   VK_j	0x6A 
-#define   VK_k	0x6B 
-#define   VK_l	0x6C 
-#define   VK_m	0x6D 
-#define   VK_n	0x6E 
-#define   VK_o	0x6F 
-#define   VK_p	0x70 
-#define   VK_q	0x71 
-#define   VK_r	0x72 
-#define   VK_s	0x73 
-#define   VK_t	0x74 
-#define   VK_u	0x75 
-#define   VK_v	0x76 
-#define   VK_w	0x77 
-#define   VK_x	0x78 
-#define   VK_y	0x79 
-#define   VK_z	0x7A 
-
 namespace GAssist
 {
 	enum {
@@ -198,4 +129,33 @@ namespace GAssist
 	BOOL IsWin10DpiScaleEanbled();
 };
 
+// 所有坐标,都是基于游戏窗口的相对坐标值;
+// 游戏窗口:802*627
+namespace GameAssist{
+	// 设置游戏窗口前置;
+	void SetGameForeground(HWND hWnd);
+	// 判断游戏窗口是否前置;
+	bool IsGameForeground(HWND hWnd);
+	// 将窗口坐标转化为屏幕坐标;
+	BOOL GamePos2Screen(HWND hWnd, POINT &pt, bool bOffset = false);
+	// 将屏幕坐标转化为游戏坐标;
+	BOOL ScreenPos2Game(HWND hWnd, POINT& pt);
+	// 鼠标移动;
+	void MouseMove(POINT pt, bool bSetCurPos = true);
+	// 鼠标单击;
+	void MouseClick();
+	void MouseClick(POINT pt);
+	// 鼠标双击;
+	void MouseDbClick();
+	void MouseDbClick(POINT pt);
+	// 鼠标右击;
+	void MouseRClick();
+	void MouseRClick(POINT pt);
+	// 鼠标拖动;
+	void MouseDrag(POINT pt);
+
+	// 发送按键;
+	void SendKey(DWORD key, BOOL bCtrl = FALSE, BOOL bAtl = FALSE, BOOL bShift = FALSE);
+};
+
 #endif // __ASSIST__

+ 5 - 4
GameAssist/GameAssist/GameAssist.rc

@@ -53,8 +53,8 @@ BEGIN
     "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)\r\n"
     "LANGUAGE 4, 2\r\n"
     "#pragma code_page(936)\r\n"
-    "#include ""res\\GameAssist.rc2""  // 闂?Microsoft Visual C++ 缂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧湱鎲搁悧鍫濈瑲闁稿顑夐弻锝夊箛椤掑倷绮靛銈嗗姌婵倝濡甸崟顖氱疀闁割偅娲橀宥夋⒑缁嬪潡顎楃紒澶婄秺瀵鈽夐姀鐘插祮闂侀潧顭堥崕鏌ユ倶閹剧粯鈷戦梻鍫熺〒婢ч亶鏌涚€n亝鍣介柟?\n"
-    "#include ""l.CHS\\afxres.rc""      // 闂傚倸鍊搁崐椋庣矆娓氣偓楠炴牠顢曢妶鍥╃厠闂佸搫顦伴崵姘洪鍕幯冾熆鐠虹尨韬俊顐㈠槻椤啴濡堕崱娆忣潷缂備緡鍠栧ù閿嬬珶閺囩喓闄勯柛娑橈功閸橀亶姊洪崫鍕偍闁告柨顑囬懞閬嶅礂缁楄桨绨?\n"
+    "#include ""res\\GameAssist.rc2""  // 闂?Microsoft Visual C++ 缂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳婀遍幉鎼佹偋閸繄鐟查梺绋款儏椤戝寮婚敐澶婄疀妞ゆ帒鍊风划闈涱渻閵堝棗濮屽┑顔哄€濇俊鐢稿礋椤栨氨鐤€闂佸壊鍋呭ú姗€顢撳澶嬧拺缂佸娼¢妤冪磼婢跺﹦绉虹€殿喛顕ч埥澶愬閻樻彃绁梻渚€娼ч…鍫ュ磿閺屻儲鍊堕柟鍓х帛閳锋垿姊婚崼鐔恒€掑褔浜堕弻娑氣偓锝庝簼閸d粙鏌?\n"
+    "#include ""l.CHS\\afxres.rc""      // 闂傚倸鍊搁崐鎼佸磹妞嬪海鐭嗗〒姘e亾妤犵偞鐗犻、鏇㈠Χ閸モ晝鍘犻梻浣告惈椤︿即宕靛顑炴椽顢旈崟骞喚鐔嗛悹铏瑰皑闊剚淇婇銏犳Щ妞ゎ亜鍟存俊鍫曞幢濞嗗浚娼风紓鍌欑贰閸犳牕霉闁垮鐝堕柡鍥╁枔闂勫嫰鏌涘☉姗堝姛闁告﹢浜跺娲传閸曨剙鍋嶉梺鍛婃煥椤戝洭鎳為柆宥呯缂佹妗ㄧ花?\n"
     "#endif\r\n"
     "\0"
 END
@@ -124,6 +124,7 @@ BEGIN
     PUSHBUTTON      "Alt+A",IDC_BUTTON12,7,207,50,14
     PUSHBUTTON      "到指定NPC坐标",IDC_BUTTON13,7,230,57,14
     COMBOBOX        IDC_COMBO2,66,231,101,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "Button14",IDC_BUTTON14,184,126,50,14
 END
 
 
@@ -233,8 +234,8 @@ END
 #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
 LANGUAGE 4, 2
 #pragma code_page(936)
-#include "res\GameAssist.rc2"  // 闂?Microsoft Visual C++ 缂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧湱鎲搁悧鍫濈瑲闁稿顑夐弻锝夊箛椤掑倷绮靛銈嗗姌婵倝濡甸崟顖氱疀闁割偅娲橀宥夋⒑缁嬪潡顎楃紒澶婄秺瀵鈽夐姀鐘插祮闂侀潧顭堥崕鏌ユ倶閹剧粯鈷戦梻鍫熺〒婢ч亶鏌涚€n亝鍣介柟?
-#include "l.CHS\afxres.rc"      // 闂傚倸鍊搁崐椋庣矆娓氣偓楠炴牠顢曢妶鍥╃厠闂佸搫顦伴崵姘洪鍕幯冾熆鐠虹尨韬俊顐㈠槻椤啴濡堕崱娆忣潷缂備緡鍠栧ù閿嬬珶閺囩喓闄勯柛娑橈功閸橀亶姊洪崫鍕偍闁告柨顑囬懞閬嶅礂缁楄桨绨?
+#include "res\GameAssist.rc2"  // 闂?Microsoft Visual C++ 缂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳婀遍幉鎼佹偋閸繄鐟查梺绋款儏椤戝寮婚敐澶婄疀妞ゆ帒鍊风划闈涱渻閵堝棗濮屽┑顔哄€濇俊鐢稿礋椤栨氨鐤€闂佸壊鍋呭ú姗€顢撳澶嬧拺缂佸娼¢妤冪磼婢跺﹦绉虹€殿喛顕ч埥澶愬閻樻彃绁梻渚€娼ч…鍫ュ磿閺屻儲鍊堕柟鍓х帛閳锋垿姊婚崼鐔恒€掑褔浜堕弻娑氣偓锝庝簼閸d粙鏌?
+#include "l.CHS\afxres.rc"      // 闂傚倸鍊搁崐鎼佸磹妞嬪海鐭嗗〒姘e亾妤犵偞鐗犻、鏇㈠Χ閸モ晝鍘犻梻浣告惈椤︿即宕靛顑炴椽顢旈崟骞喚鐔嗛悹铏瑰皑闊剚淇婇銏犳Щ妞ゎ亜鍟存俊鍫曞幢濞嗗浚娼风紓鍌欑贰閸犳牕霉闁垮鐝堕柡鍥╁枔闂勫嫰鏌涘☉姗堝姛闁告﹢浜跺娲传閸曨剙鍋嶉梺鍛婃煥椤戝洭鎳為柆宥呯缂佹妗ㄧ花?
 #endif
 
 /////////////////////////////////////////////////////////////////////////////

+ 34 - 0
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -1084,6 +1084,7 @@ BEGIN_MESSAGE_MAP(CGameAssistDlg, CDialog)
 	ON_BN_CLICKED(IDC_BUTTON11, &CGameAssistDlg::OnBnClickedButton11)
 	ON_BN_CLICKED(IDC_BUTTON12, &CGameAssistDlg::OnBnClickedButton12)
 	ON_BN_CLICKED(IDC_BUTTON13, &CGameAssistDlg::OnBnClickedButton13)
+	ON_BN_CLICKED(IDC_BUTTON14, &CGameAssistDlg::OnBnClickedButton14)
 END_MESSAGE_MAP()
 
 
@@ -1131,6 +1132,7 @@ BOOL CGameAssistDlg::OnInitDialog()
 
 	OnBnClickedButton11();
 
+
 	return TRUE;  // 除非将焦点设置到控件,否则返回 TRUE
 }
 
@@ -1958,3 +1960,35 @@ void CGameAssistDlg::OnBnClickedButton13() // 
 	}
 
 }
+
+
+void CGameAssistDlg::OnBnClickedButton14()
+{
+	HWND hWnd = GetCurGameWnd();
+	POINT pt = { 305, 325 };
+	POINT pt2 = { 160, 435 };
+	GameAssist::GamePos2Screen(hWnd, pt);
+	// TODO: 在此添加控件通知处理程序代码
+	
+#if 0
+	GameAssist::MouseMove(pt);
+	GameAssist::MouseClick();
+	//{ 160, 435 }
+	Sleep(3000);
+	pt = { 160, 435 };
+	GameAssist::GamePos2Screen(hWnd, pt);
+	GameAssist::MouseMove(pt);
+	GameAssist::MouseClick();
+#endif
+
+#if 0
+	GameAssist::MouseMove(pt);
+	GameAssist::MouseClick();
+	//{ 160, 435 }
+	Sleep(3000);
+	pt = { 160, 435 };
+	GameAssist::GamePos2Screen(hWnd, pt);
+	GameAssist::MouseMove(pt);
+	GameAssist::MouseClick();
+#endif
+}

+ 1 - 0
GameAssist/GameAssist/GameAssistDlg.h

@@ -52,4 +52,5 @@ public:
 	afx_msg void OnBnClickedButton12();
 	CComboBox m_cbZYNPC;
 	afx_msg void OnBnClickedButton13();
+	afx_msg void OnBnClickedButton14();
 };

+ 69 - 0
GameAssist/GameAssist/VirturalKey.h

@@ -0,0 +1,69 @@
+#pragma once
+
+//定义数据字符0~9
+#define   VK_0         0x30 
+#define   VK_1         0x31 
+#define   VK_2         0x32 
+#define   VK_3         0x33 
+#define   VK_4         0x34 
+#define   VK_5         0x35 
+#define   VK_6         0x36 
+#define   VK_7         0x37 
+#define   VK_8         0x38 
+#define   VK_9         0x39
+
+//定义数据字符A~Z
+#define   VK_A	0x41 
+#define   VK_B	0x42 
+#define   VK_C	0x43 
+#define   VK_D	0x44 
+#define   VK_E	0x45 
+#define   VK_F	0x46 
+#define   VK_G	0x47 
+#define   VK_H	0x48 
+#define   VK_I	0x49 
+#define   VK_J	0x4A 
+#define   VK_K	0x4B 
+#define   VK_L	0x4C 
+#define   VK_M	0x4D 
+#define   VK_N	0x4E 
+#define   VK_O	0x4F 
+#define   VK_P	0x50 
+#define   VK_Q	0x51 
+#define   VK_R	0x52 
+#define   VK_S	0x53 
+#define   VK_T	0x54 
+#define   VK_U	0x55 
+#define   VK_V	0x56 
+#define   VK_W	0x57 
+#define   VK_X	0x58 
+#define   VK_Y	0x59 
+#define   VK_Z	0x5A 
+
+//定义数据字符a~z
+#define   VK_a	0x61 
+#define   VK_b	0x62 
+#define   VK_c	0x63 
+#define   VK_d	0x64 
+#define   VK_e	0x65 
+#define   VK_f	0x66 
+#define   VK_g	0x67 
+#define   VK_h	0x68 
+#define   VK_i	0x69 
+#define   VK_j	0x6A 
+#define   VK_k	0x6B 
+#define   VK_l	0x6C 
+#define   VK_m	0x6D 
+#define   VK_n	0x6E 
+#define   VK_o	0x6F 
+#define   VK_p	0x70 
+#define   VK_q	0x71 
+#define   VK_r	0x72 
+#define   VK_s	0x73 
+#define   VK_t	0x74 
+#define   VK_u	0x75 
+#define   VK_v	0x76 
+#define   VK_w	0x77 
+#define   VK_x	0x78 
+#define   VK_y	0x79 
+#define   VK_z	0x7A 

+ 2 - 1
GameAssist/GameAssist/resource.h

@@ -35,6 +35,7 @@
 #define IDC_BUTTON12                    1025
 #define IDC_BUTTON13                    1026
 #define IDC_COMBO2                      1027
+#define IDC_BUTTON14                    1028
 
 // Next default values for new objects
 // 
@@ -42,7 +43,7 @@
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        129
 #define _APS_NEXT_COMMAND_VALUE         32771
-#define _APS_NEXT_CONTROL_VALUE         1028
+#define _APS_NEXT_CONTROL_VALUE         1029
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif

+ 1 - 1
GameAssist/GameAssist/stdafx.h

@@ -74,5 +74,5 @@
 #include <Shlwapi.h>
 #pragma comment(lib,"Shlwapi.lib") /*需要加上此行才可以正确link,VC6.0*/
 #include <tlhelp32.h>
-
+#include "VirturalKey.h"
 #include "Assist.h"