后台模拟按键(39)

冬月

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
一个FORM上放一个WebBrowser1,模拟Ctrl+Enter组合按键向WebBrowser1发送,用了 keybd_event(VK_Control, MapVirtualKey(VK_Control, 0), 0, 0); //按下Ctrl键 keybd_event(VK_Return, MapVirtualKey(VK_Return, 0), 0, 0); keybd_event(VK_Return, MapVirtualKey(VK_Return, 0), KEYEVENTF_KEYUP, 0); keybd_event(VK_Control, MapVirtualKey(VK_Control, 0), KEYEVENTF_KEYUP, 0); //放开Ctrl键可以,但是当窗体不是当前窗体,或者最小化的时候不起作用。用了PostMessage(WebBrowser1.Handle, WM_KEYDOWN, VK_Control, 0); PostMessage(WebBrowser1.Handle, WM_KEYDOWN, VK_Return, 0); PostMessage(WebBrowser1.Handle, WM_KEYUP, VK_Control, 0); PostMessage(WebBrowser1.Handle, WM_KEYUP, VK_Return, 0);没用,请教高手
 

冬月

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
WebBrowser1如何提交一个没有name属性的网页提交按键?比如<a class="btn_sm" href="javascript:;" onClick="validatereply();return false;"><span>写好了,发布</span></a>这样的提交按键
 
C

cactus123456

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
http://cactusprogram.appspot.com/?p=25003
 
H

hongfeng0727

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
V

Vsun

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
运行webbrowser中的脚本或函数。Form1.WebBrowser1.OleObject.Document.parentWindow.execScript('validatereply();','JavaScript');如果该函数不是JavaScript所写,就将第二个参数改为相应的参数即可。参数可以为JScript, JavaScript, VBSCript三个之一。
 
D

delphfans

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
不用这个可以看下自动填表 函数,然后可以从中取到对象 直接调用click 方法就可以。
 
X

xernet

Unregistered / Unconfirmed
GUEST, post messages is not allowed!
用工具抓包,看包里面的HTTP头信息,然后再用idHTTP模拟发包,省去WebBrowser带来的麻烦!
 
Top Bottom