模拟鼠标单击,使用 VOID mouse_event( DWORD dwFlags, // flags specifying various motion/click variants DWORD dx, // horizontal mouse position or position change DWORD dy, // vertical mouse position or position change DWORD dwData, // amount of wheel movement DWORD dwExtraInfo // 32 bits of application-defined information );
ShellExecute(NULL, _T("open"), "http://www.google.com/search?hl=zh-CN&q=hello&lr=", NULL,NULL, SW_SHOW);
VOID mouse_event(
DWORD dwFlags, // flags specifying various motion/click variants
DWORD dx, // horizontal mouse position or position change
DWORD dy, // vertical mouse position or position change
DWORD dwData, // amount of wheel movement
DWORD dwExtraInfo
// 32 bits of application-defined information
);
{
CString cmd;
cmd.format("http://www.google.com/search?hl=zh-CN&q=hello&lr=%s",m_strCmd);
ShellExecute(NULL, _T("open"), cmd, NULL,NULL, SW_SHOW);
}m_strCmd里面保存要搜索的字符串
{
CString cmd;
cmd.format("http://www.google.com/search?hl=zh-CN&q=hello&lr=%s",m_strCmd.GetBuffer(0));
ShellExecute(NULL, _T("open"), cmd.GetBuffer(0), NULL,NULL, SW_SHOW);
}
晕1。不要模拟键盘鼠标2.不是仅仅出现搜索GOOGLE,我是想学单击网页按钮
”
可能是你提问有问题:
应该是
“编程实现表单的填写和提交”吧???
然后枚举找到需要的表单元素(通过比较tagName或者通过查询IHTMLFormElement接口)
之后访问表单元素的element获得表单项元素集合
然后枚举找到需要的输入域元素(通过比较tagName或者通过查询IHTMLInputElement接口)
之后访问输入域元素的value属性