12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #ifndef __ASSIST__
- #define __ASSIST__
- #pragma once
- namespace GAssist
- {
- //const TCHAR g_szGamePath[MAX_PATH] = _T("E:\\dhsh\\shdata\\Main.exe");
- const TCHAR g_szGamePath[MAX_PATH] = _T("D:\\tools\\dhsh\\shdata\\Main.exe");
- extern DWORD FindProcess(IN LPCSTR lpProName);
- extern HWND GetProHwnd(DWORD dwProcessId);
- extern BOOL CALLBACK EnumChildWindowCallBack(HWND hWnd, LPARAM lParam);
- typedef struct __GAME_HWNINFO__{
- DWORD dwId; // 控件id;
- std::string strWinText; // 控件文本;
- std::string strClassName; // 控件类名;
- HWND hwnd; // 控件句柄;
- }GameHwnd, *pGameHwnd;
- extern std::vector<GameHwnd> g_vtGameHwnd;
- typedef struct __GAC__ {
- bool bLogin; // 登录状态;
- std::string strAccount; // 账号;
- std::string strPassword; // 密码;
- unsigned long lRoleNumber; // 角色ID;
- std::string strRoleName; // 角色名称;
- std::string strRoleType; // 角色类型:剑客、武师、医师、道士、术士;
- unsigned short nRoleLevel; // 角色等级;
- std::string strRoleZone; // 角色所在区:电信一区……;
- std::string strRoleSuit; // 角色所在服:忘忧谷;
- // 关联某进程信息;
- unsigned long lProcId; // 进程ID;
- HWND hWnd; // 进程窗口句柄;
- unsigned char wndType; // 窗口类型:0=小窗口、1=大窗口、2=全屏;
- std::string strWndText; // 窗口名称;
- __GAC__() {
- bLogin = false;
- lProcId = 0;
- lRoleNumber = 0;
- nRoleLevel = 0;
- wndType = 0;
- }
- }GUserInfo, *PGUserInfo;
- extern std::vector<GUserInfo> g_vtGUserInfo;
- // 启动游戏;
- extern void StartGame(std::string strGameDir, int nStartCount = 5);
- // 单击事件;
- extern void MouseClick(HWND hwnd, POINT pt);
- extern void MouseClick(HWND hwnd, unsigned int x, unsigned int y);
- // 移动鼠标;
- extern void MouseMove(HWND hwnd, POINT pt);
- extern void MouseMove(HWND hwnd, POINT ptStart, POINT ptEnd);
- extern void MouseMoveEx(HWND hwnd, POINT ptStart, POINT ptEnd);
- // 拖动鼠标;
- extern void DragMouse(HWND hwnd, POINT ptStart, POINT ptEnd);
- // 截图;
- HBITMAP CopyDC2Bitmap(HWND hWnd, LPRECT lpRect);
- // 保存图片;
- BOOL SaveBitmap(HBITMAP hBitmpa, std::string strSavePath);
- void SaveHwndToBmpFile(HWND hWnd, LPCTSTR lpszPath);
- };
- #endif // __ASSIST__
|