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;