小子登徒 发表于 2013-7-10 13:34:01

精灵应用盒子按键模拟教程(2013-07-10)

按键模拟分为前台模拟和后台模拟,前台模拟不需要句柄,后台模拟需要句柄。
以下为模拟中使用的函数,调用时前面加JL.    如JL.Find("", "notepad");

模拟为接口中实现。第一行要加上引入模拟库:var USE_LIB_NAMES = "JLPlugin";

MoveTo(x: Integer; y: Integer):鼠标移动函数
Delay(msecs: Integer)):延迟函数,参数为毫秒
MsgBox(const title: WideString; const msg: WideString) :提示框
LeftDown 左键按下
LeftUp 左键松开
LeftClick 左键单击
RightClick 右键单击
MiddleClick 中键单击
LeftDoubleClick 左键双击
RightDown 右键按下
RightUp 右键松开
KeyDown(const s: WideString) 按下参数s相应的键,支持特殊键为
    ALT,CTRL,SHIFT,BACKSPACE,TAB,WIN,DOWN,RIGHT,LEFT,UP,END,PAGEDOWN,PAGEUP,HOME,DELETE,INSERT,PRINT SCREEN,PAUSE/BREAK,F12,ENTER,ESC

keyUp(const s: WideString) 松开
SendKeys(const s: WideString) 发送多个键,支持复杂键如@#$
RunApp(const path: WideString) 运行应用
KillTask(const taskname: WideString) 结束进程
GetPixelColor(x: Integer; y: Integer): string取x,y坐标上的颜色
Capture(x1: Integer; y1: Integer; x2: Integer; y2: Integer; const path: WideString) 截取左上角x1,y1, 右下角x2,y2相应的图片保存进path
propYZM(const yzmdz: WideString; zdtjws: Integer; const yzmlx: WideString):string弹出验证码,参数为地址,自动提交位数 验证码类型,返回值为验证码
GetWindowRect(hwnd: Integer): WideString 获取句柄窗口的坐标信息,返回值以|分隔
Find(const className: WideString; const hWndTitle: WideString): Integer 查找窗口,返回句柄
FindEx(hwndParent: Integer; hwndChildAfter: Integer; const lpszClass: WideString;
                  const lpszWindow: WideString): Integer;   查找子窗口,返回句柄
GetClientRect(hwnd: Integer): WideString; 获取句柄窗口的客户区坐标信息,返回值以|分隔
Active(hwnd: Integer) 激活窗口
Top(hwnd: Integer; sign: Integer) 置前, sign模式:0=(置前),1=(取消置前)
addtips(const msg: WideString) 盒子中增加提示

后台模拟
LeftClickB(hwnd: Integer; x: Integer; y: Integer);
LeftDoubleClickB(hwnd: Integer; x: Integer; y: Integer)
KeyDownB(hwnd: Integer; const s: WideString);
KeyUpB(hwnd: Integer; const s: WideString);
SendKeysB(hwnd: Integer; const s: WideString);
sendStringB(hwnd: Integer; const msg: WideString);
GetPixelColorB(hwnd: Integer; x: Integer; y: Integer): WideString;
CaptureB(hwnd: Integer; x1: Integer; y1: Integer; x2: Integer; y2: Integer;
                     const path: WideString);





不知 发表于 2018-12-27 17:09:18

看不懂{:2_281:}
页: [1]
查看完整版本: 精灵应用盒子按键模拟教程(2013-07-10)