加载DLL动态库
提示
需要使用LoadLibraryA()
命令,加载DLL动态库,才可以正常使用。
其他语言皆是一样,操作命令有所不同而已!
示例
#include <iostream>
#include <filesystem>
#include <windows.h>
// 获取当前运行目录
std::filesystem::path current_path = std::filesystem::current_path();
// DLL 路径
std::filesystem::path dll_path = current_path / "EtpBot.dll";
// 加载 DLL
HMODULE hModuleA = LoadLibraryA (dll_path.string().c_str());
if (hModuleA == nullptr) {
DWORD error = GetLastError();
std::cerr << "Failed to load DLL: " << dll_path << std::endl;
std::cerr << "Error code: " << error << std::endl;
return 1;
}
// 定义函数指针
auto EB_激活服务 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_激活服务"));
auto EB_停止服务 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_停止服务"));
auto EB_连接设备 = (int(__stdcall*)(int Mode, const char* Serial))(GetProcAddress(hModuleA, "EB_连接设备"));
auto EB_Shell命令 = (const char* (__stdcall*)(const char* Serial, const char* Command))(GetProcAddress(hModuleA, "EB_Shell命令"));
auto EB_延时 = (void(__stdcall*)(const char* Serial, int Time))(GetProcAddress(hModuleA, "EB_延时"));
auto EB_取错误信息 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_取错误信息"));
auto EB_按键_返回键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_返回键"));
auto EB_按键_Home键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_Home键"));
auto EB_按键_菜单键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_菜单键"));
auto EB_按键_电源键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_电源键"));
auto EB_按键_切换应用 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_切换应用"));
auto EB_按键_静音键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_静音键"));
auto EB_按键_删除键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_删除键"));
auto EB_按键_音量加 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_音量加"));
auto EB_按键_音量减 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_音量减"));
auto EB_按键_屏幕亮度减 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_屏幕亮度减"));
auto EB_按键_屏幕亮度加 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_屏幕亮度加"));
auto EB_按键_向下键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_向下键"));
auto EB_按键_向上键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_向上键"));
auto EB_按键_向左键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_向左键"));
auto EB_按键_向右键 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_按键_向右键"));
auto EB_按键_键码 = (void(__stdcall*)(const char* Serial, int keycode))(GetProcAddress(hModuleA, "EB_按键_键码"));
auto EB_模拟_按下 = (int(__stdcall*)(const char* Serial, int x, int y))(GetProcAddress(hModuleA, "EB_模拟_按下"));
auto EB_模拟_放开 = (int(__stdcall*)(const char* Serial, int x, int y))(GetProcAddress(hModuleA, "EB_模拟_放开"));
auto EB_模拟_移动 = (int(__stdcall*)(const char* Serial, int x, int y))(GetProcAddress(hModuleA, "EB_模拟_移动"));
auto EB_模拟_点击 = (int(__stdcall*)(const char* Serial, int x, int y))(GetProcAddress(hModuleA, "EB_模拟_点击"));
auto EB_模拟_拖动 = (int(__stdcall*)(const char* Serial, int x, int y, int ex, int ey, int Step))(GetProcAddress(hModuleA, "EB_模拟_拖动"));
auto EB_模拟_滑动 = (int(__stdcall*)(const char* Serial, int x, int y, int ex, int ey, int Step))(GetProcAddress(hModuleA, "EB_模拟_滑动"));
auto EB_模拟_滚动 = (void(__stdcall*)(const char* Serial, int x, int y))(GetProcAddress(hModuleA, "EB_模拟_滚动"));
auto EB_模拟_长按 = (void(__stdcall*)(const char* Serial, int x, int y, int Time))(GetProcAddress(hModuleA, "EB_模拟_长按"));
auto EB_模拟_输入 = (int(__stdcall*)(const char* Serial, const char* Str))(GetProcAddress(hModuleA, "EB_模拟_输入"));
auto EB_系统_取CPU = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取CPU"));
auto EB_系统_取DPI = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取DPI"));
auto EB_系统_取SDK = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取SDK"));
auto EB_系统_取IMSI = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取IMSI"));
auto EB_系统_取IMEI = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取IMEI"));
auto EB_系统_取品牌 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取品牌"));
auto EB_系统_取型号 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取型号"));
auto EB_系统_取名称 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取名称"));
auto EB_系统_取iccid = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取iccid"));
auto EB_系统_取版本号 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取版本号"));
auto EB_系统_取分辨率 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取分辨率"));
auto EB_系统_取主板号 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取主板号"));
auto EB_系统_取ip地址 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取ip地址"));
auto EB_系统_取MAC地址 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取MAC地址"));
auto EB_系统_取SIM序号 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取SIM序号"));
auto EB_系统_取SN序号 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取SN序号"));
auto EB_系统_取安卓ID = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取安卓ID"));
auto EB_系统_取电量 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取电量"));
auto EB_系统_取手机厂商 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取手机厂商"));
auto EB_系统_取手机号码 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取手机号码"));
auto EB_系统_取网关 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取网关"));
auto EB_系统_取唯一标识 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取唯一标识"));
auto EB_系统_取系统属性 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取系统属性"));
auto EB_系统_取已运行时间 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取已运行时间"));
auto EB_系统_取屏幕宽度 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取屏幕宽度"));
auto EB_系统_取屏幕高度 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取屏幕高度"));
auto EB_系统_取屏幕方向 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取屏幕方向"));
auto EB_系统_取屏幕状态 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取屏幕状态"));
auto EB_系统_取安卓版本号 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取安卓版本号"));
auto EB_系统_取运营商名称 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取运营商名称"));
auto EB_系统_取外网ip地址 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_取外网ip地址"));
auto EB_系统_置DPI = (void(__stdcall*)(const char* Serial, const char* DPI))(GetProcAddress(hModuleA, "EB_系统_置DPI"));
auto EB_系统_置MAC = (void(__stdcall*)(const char* Serial, const char* MAC))(GetProcAddress(hModuleA, "EB_系统_置MAC"));
auto EB_系统_置IMEI = (void(__stdcall*)(const char* Serial, const char* IMEI))(GetProcAddress(hModuleA, "EB_系统_置IMEI"));
auto EB_系统_置IMSI = (void(__stdcall*)(const char* Serial, const char* IMSI))(GetProcAddress(hModuleA, "EB_系统_置IMSI"));
auto EB_系统_置安卓ID = (void(__stdcall*)(const char* Serial, const char* ID))(GetProcAddress(hModuleA, "EB_系统_置安卓ID"));
auto EB_系统_置分辨率 = (void(__stdcall*)(const char* Serial, const char* Resolution))(GetProcAddress(hModuleA, "EB_系统_置分辨率"));
auto EB_系统_置手机厂商 = (void(__stdcall*)(const char* Serial, const char* mf))(GetProcAddress(hModuleA, "EB_系统_置手机厂商"));
auto EB_系统_置手机号码 = (void(__stdcall*)(const char* Serial, const char* Number))(GetProcAddress(hModuleA, "EB_系统_置手机号码"));
auto EB_系统_置手机型号 = (void(__stdcall*)(const char* Serial, const char* Model))(GetProcAddress(hModuleA, "EB_系统_置手机型号"));
auto EB_系统_置剪辑板文本 = (void(__stdcall*)(const char* Serial, const char* Str))(GetProcAddress(hModuleA, "EB_系统_置剪辑板文本"));
auto EB_系统_关机 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_关机"));
auto EB_系统_重启 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_重启"));
auto EB_系统_广播 = (void(__stdcall*)(const char* Serial, const char* data, const char* Module))(GetProcAddress(hModuleA, "EB_系统_广播"));
auto EB_系统_是否开启wifi = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_是否开启wifi"));
auto EB_系统_是否开启蓝牙 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_是否开启蓝牙"));
auto EB_系统_显示触摸操作 = (void(__stdcall*)(const char* Serial, bool off))(GetProcAddress(hModuleA, "EB_系统_显示触摸操作"));
auto EB_系统_开启指针位置 = (void(__stdcall*)(const char* Serial, bool off))(GetProcAddress(hModuleA, "EB_系统_开启指针位置"));
auto EB_系统_开关wifi = (void(__stdcall*)(const char* Serial, bool off))(GetProcAddress(hModuleA, "EB_系统_开关wifi"));
auto EB_系统_开关飞行模式 = (void(__stdcall*)(const char* Serial, bool off))(GetProcAddress(hModuleA, "EB_系统_开关飞行模式"));
auto EB_系统_开关数据流量 = (void(__stdcall*)(const char* Serial, bool off))(GetProcAddress(hModuleA, "EB_系统_开关数据流量"));
auto EB_系统_展开通知栏 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_展开通知栏"));
auto EB_系统_展开设置栏 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_展开设置栏"));
auto EB_系统_折叠通知栏 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_折叠通知栏"));
auto EB_系统_折叠设置栏 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_系统_折叠设置栏"));
auto EB_系统_打开设置界面 = (void(__stdcall*)(const char* Serial, const char* Action))(GetProcAddress(hModuleA, "EB_系统_打开设置界面"));
auto EB_系统_图库刷新 = (int(__stdcall*)(const char* Serial,const char* path))(GetProcAddress(hModuleA, "EB_系统_图库刷新"));
auto EB_系统_图片刷新 = (int(__stdcall*)(const char* Serial,const char* path))(GetProcAddress(hModuleA, "EB_系统_图片刷新"));
auto EB_系统_清除通知栏消息 = (void(__stdcall*)(const char* Serial, const char* ID))(GetProcAddress(hModuleA, "EB_系统_清除通知栏消息"));
auto EB_应用_启动 = (void(__stdcall*)(const char* Serial, const char* Package, const char* Class))(GetProcAddress(hModuleA, "EB_应用_启动"));
auto EB_应用_关闭 = (void(__stdcall*)(const char* Serial, const char* Package))(GetProcAddress(hModuleA, "EB_应用_关闭"));
auto EB_应用_卸载 = (int(__stdcall*)(const char* Serial, const char* Package, bool Retain))(GetProcAddress(hModuleA, "EB_应用_卸载"));
auto EB_应用_是否运行 = (int(__stdcall*)(const char* Serial, const char* Package))(GetProcAddress(hModuleA, "EB_应用_是否运行"));
auto EB_应用_是否安装 = (int(__stdcall*)(const char* Serial, const char* Package))(GetProcAddress(hModuleA, "EB_应用_是否安装"));
auto EB_应用_是否前台 = (int(__stdcall*)(const char* Serial, const char* Package))(GetProcAddress(hModuleA, "EB_应用_是否前台"));
auto EB_应用_取安装目录 = (const char* (__stdcall*)(const char* Serial, const char* Package))(GetProcAddress(hModuleA, "EB_应用_取安装目录"));
auto EB_应用_取app版本号 = (const char* (__stdcall*)(const char* Serial, const char* Package))(GetProcAddress(hModuleA, "EB_应用_取app版本号"));
auto EB_应用_取APK路径 = (const char* (__stdcall*)(const char* Serial, const char* Package))(GetProcAddress(hModuleA, "EB_应用_取APK路径"));
auto EB_应用_取当前包名 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_应用_取当前包名"));
auto EB_应用_取当前APP名 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_应用_取当前APP名"));
auto EB_应用_取当前Activity = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_应用_取当前Activity"));
auto EB_应用_启动Activity = (void(__stdcall*)(const char* Serial, const char* Action, const char* Url, const char* Pkg, const char* Flag))(GetProcAddress(hModuleA, "EB_应用_启动Activity"));
auto EB_应用_清除缓存 = (int(__stdcall*)(const char* Serial, const char* Package))(GetProcAddress(hModuleA, "EB_应用_清除缓存"));
auto EB_应用_等待吐司 = (const char* (__stdcall*)(const char* Serial, const char* Package, int Time))(GetProcAddress(hModuleA, "EB_应用_等待吐司"));
auto EB_应用_等待窗口更新 = (int(__stdcall*)(const char* Serial, const char* Package, int Time))(GetProcAddress(hModuleA, "EB_应用_等待窗口更新"));
auto EB_应用_跳转应用详情 = (void(__stdcall*)(const char* Serial, const char* Package))(GetProcAddress(hModuleA, "EB_应用_跳转应用详情"));
auto EB_应用_Scheme跳转 = (void(__stdcall*)(const char* Serial, const char* Url))(GetProcAddress(hModuleA, "EB_应用_Scheme跳转"));
auto EB_屏幕_截屏 = (int* (__stdcall*)(const char* Serial, int Format))(GetProcAddress(hModuleA, "EB_屏幕_截屏"));
auto EB_屏幕_唤醒 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_屏幕_唤醒"));
auto EB_屏幕_息屏 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_屏幕_息屏"));
auto EB_屏幕_保持唤醒 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_屏幕_保持唤醒"));
auto EB_屏幕_取消保持唤醒 = (void(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_屏幕_取消保持唤醒"));
auto EB_屏幕_区域截图 = (int* (__stdcall*)(const char* Serial, int x, int y, int ex, int ey, int Format))(GetProcAddress(hModuleA, "EB_屏幕_区域截图"));
auto EB_屏幕_截屏到手机 = (void(__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_屏幕_截屏到手机"));
auto EB_目录_创建 = (void(__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_目录_创建"));
auto EB_目录_删除 = (void(__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_目录_删除"));
auto EB_文件_查看 = (const char* (__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_文件_查看"));
auto EB_文件_写入 = (void(__stdcall*)(const char* Serial, const char* Str, bool WriteTail))(GetProcAddress(hModuleA, "EB_文件_写入"));
auto EB_文件_创建 = (void(__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_文件_创建"));
auto EB_文件_删除 = (int(__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_文件_删除"));
auto EB_文件_移动 = (void(__stdcall*)(const char* Serial, const char* DPath, const char* PPath))(GetProcAddress(hModuleA, "EB_文件_移动"));
auto EB_文件_是否存在 = (int(__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_文件_是否存在"));
auto EB_文件_取md5 = (const char* (__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_文件_取md5"));
auto EB_文件_取文件尺寸 = (int(__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_文件_取文件尺寸"));
auto EB_文件_取文件权限 = (const char* (__stdcall*)(const char* Serial, const char* Path))(GetProcAddress(hModuleA, "EB_文件_取文件权限"));
auto EB_文件_修改权限 = (void(__stdcall*)(const char* Serial, const char* Permission, const char* Path))(GetProcAddress(hModuleA, "EB_文件_修改权限"));
auto EB_文件_上传文件EX = (int(__stdcall*)(const char* Serial, int* p, const char* Path))(GetProcAddress(hModuleA, "EB_文件_上传文件EX"));
auto EB_文件_上传文件 = (int(__stdcall*)(const char* Serial, const char* PPath, const char* DPath))(GetProcAddress(hModuleA, "EB_文件_上传文件"));
auto EB_文件_下载文件 = (int(__stdcall*)(const char* Serial, const char* DPath, const char* PPath))(GetProcAddress(hModuleA, "EB_文件_下载文件"));
auto EB_进程_查询 = (int(__stdcall*)(const char* Serial, const char* Name))(GetProcAddress(hModuleA, "EB_进程_查询"));
auto EB_进程_结束进程 = (void(__stdcall*)(const char* Serial, int Pid))(GetProcAddress(hModuleA, "EB_进程_结束进程"));
auto EB_进程_进程列表 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_进程_进程列表"));
auto EB_输入法_获取当前输入法ID = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_输入法_获取当前输入法ID"));
auto EB_输入法_获取列表 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_输入法_获取列表"));
auto EB_输入法_开关 = (int(__stdcall*)(const char* Serial, const char* ID, bool Off))(GetProcAddress(hModuleA, "EB_输入法_开关"));
auto EB_输入法_切换 = (int(__stdcall*)(const char* Serial, const char* ID))(GetProcAddress(hModuleA, "EB_输入法_切换"));
auto EB_网络_下载 = (const char* (__stdcall*)(const char* Serial, const char* Url, const char* Path))(GetProcAddress(hModuleA, "EB_网络_下载"));
auto EB_网络_访问 = (const char* (__stdcall*)(const char* Serial, int Type, const char* Url, const char* Data, const char* Header))(GetProcAddress(hModuleA, "EB_网络_访问"));
auto EB_节点_取XML = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_节点_取XML"));
auto EB_节点_取Json = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_节点_取Json"));
auto EB_节点_刷新 = (void (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_节点_刷新"));
auto EB_节点_查找 = (int(__stdcall*)(const char* Serial, const char* Text, const char* Res, const char* Class, const char* Package, const char* Desc, int Time))(GetProcAddress(hModuleA, "EB_节点_查找"));
auto EB_节点_查找EX = (const char*(__stdcall*)(const char* Serial, const char* Index, const char* Text, const char* Res, const char* Class, const char* Package, const char* Desc, const char* Checkable, const char* Checked, const char* Clickable, const char* Enabled, const char* Focusable, const char* Focused, const char* Scrollable, const char* Longclickable, const char* Selected, const char* Bounds, int Num, int Time))(GetProcAddress(hModuleA, "EB_节点_查找EX"));
auto EB_节点_查找子节点 = (int(__stdcall*)(const char* Serial, int hWnd, const char* Text, const char* Res, const char* Class, const char* Package, const char* Desc))(GetProcAddress(hModuleA, "EB_节点_查找子节点"));
auto EB_节点_查找子节点EX = (const char*(__stdcall*)(const char* Serial, int hWnd, const char* Index, const char* Text, const char* Res, const char* Class, const char* Package, const char* Desc, const char* Checkable, const char* Checked, const char* Clickable, const char* Enabled, const char* Focusable, const char* Focused, const char* Scrollable, const char* Longclickable, const char* Selected, const char* Bounds, int Num))(GetProcAddress(hModuleA, "EB_节点_查找子节点EX"));
auto EB_节点_点击 = (int(__stdcall*)(const char* Serial, int hWnd))(GetProcAddress(hModuleA, "EB_节点_点击"));
auto EB_节点_长按 = (int(__stdcall*)(const char* Serial, int hWnd))(GetProcAddress(hModuleA, "EB_节点_长按"));
auto EB_节点_拖动 = (int(__stdcall*)(const char* Serial, int hWnd, int x, int y, int Speed))(GetProcAddress(hModuleA, "EB_节点_拖动"));
auto EB_节点_滚动 = (void(__stdcall*)(const char* Serial, int hWnd, int Direction, int Span, int Speed))(GetProcAddress(hModuleA, "EB_节点_滚动"));
auto EB_节点_滑动 = (void(__stdcall*)(const char* Serial, int hWnd, int Direction, int Span, int Speed))(GetProcAddress(hModuleA, "EB_节点_滑动"));
auto EB_节点_捏合手势 = (void(__stdcall*)(const char* Serial, int hWnd, int Span, int Speed))(GetProcAddress(hModuleA, "EB_节点_捏合手势"));
auto EB_节点_捏开手势 = (void(__stdcall*)(const char* Serial, int hWnd, int Span, int Speed))(GetProcAddress(hModuleA, "EB_节点_捏开手势"));
auto EB_节点_是否存在 = (int(__stdcall*)(const char* Serial, const char* Text, const char* Res, const char* Class, const char* Package, const char* Desc))(GetProcAddress(hModuleA, "EB_节点_是否存在"));
auto EB_节点_取父节点 = (int(__stdcall*)(const char* Serial, int hWnd))(GetProcAddress(hModuleA, "EB_节点_取父节点"));
auto EB_节点_取子节点 = (int(__stdcall*)(const char* Serial, int hWnd, int Num))(GetProcAddress(hModuleA, "EB_节点_取子节点"));
auto EB_节点_点击等待 = (int(__stdcall*)(const char* Serial, int hWnd, int Time))(GetProcAddress(hModuleA, "EB_节点_点击等待"));
auto EB_节点_输入文字 = (void(__stdcall*)(const char* Serial, int hWnd, const char* Str))(GetProcAddress(hModuleA, "EB_节点_输入文字"));
auto EB_节点_清空文字 = (void(__stdcall*)(const char* Serial, int hWnd))(GetProcAddress(hModuleA, "EB_节点_清空文字"));
auto EB_节点_设置模式 = (void(__stdcall*)(const char* Serial, int Mode))(GetProcAddress(hModuleA, "EB_节点_设置模式"));
auto EB_节点_取兄弟节点 = (int(__stdcall*)(const char* Serial, int hWnd, int Num))(GetProcAddress(hModuleA, "EB_节点_取兄弟节点"));
auto EB_节点_取节点属性 = (const char* (__stdcall*)(const char* Serial, int hWnd, int Nat))(GetProcAddress(hModuleA, "EB_节点_取节点属性"));
auto EB_节点_取子节点数量 = (int(__stdcall*)(const char* Serial, int hWnd))(GetProcAddress(hModuleA, "EB_节点_取子节点数量"));
auto EB_节点_取兄弟节点数量 = (int(__stdcall*)(const char* Serial, int hWnd))(GetProcAddress(hModuleA, "EB_节点_取兄弟节点数量"));
auto EB_图色_取色 = (const char* (__stdcall*)(const char* Serial, int x, int y))(GetProcAddress(hModuleA, "EB_图色_取色"));
auto EB_图色_找色 = (int(__stdcall*)(const char* Serial, int x, int y, int ex, int ey, const char* Color, float Sim, int Time, int* xx, int* yy))(GetProcAddress(hModuleA, "EB_图色_找色"));
auto EB_图色_找图 = (int(__stdcall*)(const char* Serial, const char* Path, int x, int y, int ex, int ey, const char* Color,float Sim, int* xx, int* yy))(GetProcAddress(hModuleA, "EB_图色_找图"));
auto EB_图色_找图Ex = (const char* (__stdcall*)(const char* Serial, const char* Name, int x, int y, int ex, int ey, const char* Color, float Sim, int Time, int* xx, int* yy))(GetProcAddress(hModuleA, "EB_图色_找图Ex"));
auto EB_图色_多点找色 = (int(__stdcall*)(const char* Serial, int x, int y, int ex, int ey, const char* Color1, const char* Color2, float Sim, int Time, int* xx, int* yy))(GetProcAddress(hModuleA, "EB_图色_多点找色"));
auto EB_图色_取图片名列表 = (const char* (__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_图色_取图片名列表"));
auto EB_图色_设置图片_路径 = (int(__stdcall*)(const char* Serial, const char* Path, const char* Name))(GetProcAddress(hModuleA, "EB_图色_设置图片_路径"));
auto EB_图色_设置图片_字节集 = (int(__stdcall*)(const char* Serial, int* img, const char* Name))(GetProcAddress(hModuleA, "EB_图色_设置图片_字节集"));
auto EB_Ocr加载数据 = (int(__stdcall*)(const char* Serial, int* Font, int* Lib))(GetProcAddress(hModuleA, "EB_Ocr加载数据"));
auto EB_Ocr初始化 = (int(__stdcall*)(const char* Serial))(GetProcAddress(hModuleA, "EB_Ocr初始化"));
auto EB_Ocr找字 = (int(__stdcall*)(const char* Serial, int x, int y, int ex, int ey, const char* Str))(GetProcAddress(hModuleA, "EB_Ocr找字"));
auto EB_Ocr找字EX = (int(__stdcall*)(const char* Serial, const char* Str))(GetProcAddress(hModuleA, "EB_Ocr找字EX"));
auto EB_Ocr识字 = (const char* (__stdcall*)(const char* Serial, int x, int y, int ex, int ey, int Confidence))(GetProcAddress(hModuleA, "EB_Ocr识字"));
激活服务
- 函数原型
int __stdcall EB_激活服务 (const char* Serial)
参数定义
Serial
[设备标识]-- ADB获取
返回值
0
-成功-1
-失败
示例
if( !EB_激活服务 ("emulator-5554") ){
printf ("激活成功");
return true;
}else {
printf ("激活失败,错误描述:%s\n", EB_取错误信息 ("emulator-5554"));
return false;
};
提示
确保ADB已连接设备, 激活之后,手机重启或停止服务需再次激活。
全局命令,请勿重复操作此命令,只需激活一次即可。
停止服务
- 函数原型
int __stdcall EB_停止服务 (const char* Serial)
- 参数定义
Serial
[设备标识]-- Adb 获取
- 返回值
0
成功-1
失败
示例
if( !EB_停止服务 ("emulator-5554") ){
printf ("停止成功");
return true;
}else {
printf ("停止失败,错误描述:%s\n", EB_取错误信息 ("emulator-5554"));
return false;
};
提示
非出现异常情况,无需停止服务。
连接设备
- 函数原型
int __stdcall EB_连接设备 (int Mode, const char* Serial )
- 参数定义
Mode
[连接模式]-- 默认USB模式0
Usb 模式1
Wifi 模式
Serial
[设备标识]-- WIFI模式填写设备IP地址
- 返回值
0
成功-1
失败
示例
if( !EB_连接设备 (1,"192.168.1.5") ){
printf ("连接成功");
return true;
}else {
printf ("连接失败,错误描述:%s\n", EB_取错误信息 ("192.168.1.5"));
return false;
};
提示
USB模式:激活服务默认USB,无需再次连接。如拔插手机或WIFI切换USB,需再次连接!
WIFI模式:激活服务后,即可拔掉USB数据线,使用IP进行连接。
Shell命令
- 函数原型
const char* __stdcall EB_Shell命令 (const char* Serial, const char* Command)
- 参数定义
Serial
[设备标识] --手机设备标识符 ADB命令获取Command
[命令]-- 不用带shell
- 返回值
""
失败
示例
const char* str = EB_Shell命令 ("emulator-5554", "am start -n com.android.settings/com.android.settings.Settings");
if( str != "" ){
printf ("执行结果:",str);
return true;
}else {
return false;
};
延时
- 函数原型
void __stdcall EB_延时 (const char* Serial, int Time)
- 参数定义
Serial
[设备标识] --手机设备标识符 ADB命令获取Time
[时间] -- 毫秒
- 返回值
- 无
示例
EB_延时 ("emulator-5554", 3000);
注意
在设备上延时。非电脑端延时
取错误信息
- 函数原型
const char* __stdcall EB_取错误信息 (const char* Serial)
- 参数定义
Serial
[设备标识] --手机设备标识符 ADB命令获取
- 返回值
""
失败
示例
printf ("错误信息:%s\n", EB_取错误信息 ("emulator-5554"));
提示
如果命令执行失败,可通过此命令查看错误描述