php模拟点击原理,[求助]模拟input点击问题[已解决]

import win.ui;

import web.form;

/*DSG{{*/

var winform = ..win.form( bottom=591;parent=...;right=983;text="aardio Form" )

winform.add(

button2={ bottom=552;right=510;left=432;top=519;z=6;text="确定";cls="button" };

edit={ bottom=551;right=420;left=341;top=518;z=5;edge=1;cls="edit" };

button={ bottom=555;text="开始";left=247;top=516;font=LOGFONT( name='宋体' );z=2;right=333;cls="button" };

picturebox={ bottom=571;right=233;left=43;top=518;font=LOGFONT( name='宋体' );transparent=1;z=1;cls="picturebox" };

static={ notify=1;right=961;left=13;top=15;font=LOGFONT( name='宋体' );z=3;bottom=512;text="static";transparent=1;cls="static" };

static2={ bottom=540;right=947;left=578;top=521;font=LOGFONT( name='宋体' );z=4;transparent=1;cls="static" }

)

/*}}*/

OpenClipboard = User32.api("OpenClipboard","int(int hwnd)" ) ;

GetClipboardData = User32.api("GetClipboardData","int (int)" )

CloseClipboard = User32.api("CloseClipboard","int()" )

GetDC = User32.api("GetDC","int(int hwnd)");

ReleaseDC = User32.api("ReleaseDC","int(int hwnd,int hdc)")

CreateCompatibleDC = Gdi32.api("CreateCompatibleDC","int(int hdc)");

SelectObject = Gdi32.api("SelectObject","int(int hwnd,int hwnd2)");

SetMapMode = Gdi32.api("SetMapMode","int(int hwnd,int hwnd2)");

BitBlt = Gdi32.api("BitBlt","int(int hdc,int x,int y,int nWidth,int nHeight,int hSrcDC,int xSrc,int ySrc,int dwRop)")

wb=web.form(winform.static);

setPic = function(hwnd){

OpenClipboard(hwnd); // 打开剪贴板

var hBitmap = GetClipboardData(0x2/*_CF_BITMAP*/); // 获取剪贴板数据句柄

var hDC = GetDC(hwnd); // 获取hwnd句柄

var hdcMem = CreateCompatibleDC(hDC); // 创建与设备相关的内存环境

SelectObject(hdcMem,hBitmap); // 选择对象

BitBlt(hDC, 0, 0, 190, 60, hdcMem, 0, 0,0xCC0020/*_SRCCOPY*/) //位图复制

ReleaseDC(hwnd, hDC); // 释放设备环境句柄

CloseClipboard(); // 关闭剪贴板

}

showTip = function(str){

winform.static2.text=str;

}

winform.button2.oncommand = function(id,event){

//winform.msgbox( winform.button2.text );

ele=wb.getEle("verifyCode");

if (ele) {

ele.value=winform.edit.text;

//这里没有直接点击登录

}

}

winform.button.oncommand = function(id,event){

//win.msgbox( winform.button.text );

wb.go("http://uac.10010.com/portal/mallLogin.jsp?redirectURL=http://service.10010.com/ehall/services.html");

showTip("等待打开网页");

wb.wait();

showTip("打开网页完毕");

ele_user=wb.getEle("userName");

if (ele_user){

ele_user.fireEvent("onfocus");

ele_user.value="13000000000";

ele_user.click();

//关键在这里,如何能让网页识别

}

ele_pass=wb.getEle("password")

if (ele_pass){

ele_pass.fireEvent("onfocus");

ele_pass.value="666888";

}

showTip("等待显示验证码");

//win.delay(4000);

ele_img=wb.getEle("captchaImg")

if (ele_img){

wb.execEle(ele_img,"Copy");

setPic(winform.picturebox.hwnd);

ele_img("完成");

}

}

winform.show()

win.loopMessage();

return winform;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值