在vc程序中如何触发网页中某个button的click方法???
iky 2001-08-14 10:23:32 白菜有一个例子,可以得到网页中的某一个元素
但是我由于无知,实在不知道是否可以得到某个button
如果可以的话,怎么触发得到的button元素的click方法(关键!!!)
请各位帮帮忙
还有,下面“白菜”的例子是不是只要在程序中加入ie的控件就可以了
不要特别的#include
void CSendMsgDlg::OnDownloadCompleteExplorer()
{
// TODO: Add your control notification handler code here
IHTMLElementCollection *objAllElement=NULL;
IHTMLDocument2 *objDocument=NULL;
CComPtr<IDispatch>pDisp;
IHTMLAnchorElement *objAnchor=NULL;
CString strUrl;
strUrl=m_ctrlWeb.GetLocationURL();
if(strUrl.IsEmpty())
return;
objDocument=(IHTMLDocument2 *)m_ctrlWeb.GetDocument();
objDocument->get_all(&objAllElement);
objAllElement->item(COleVariant("name"),COleVariant((long)0),&pDisp);
CComQIPtr<IHTMLInputTextElement, &IID_IHTMLInputTextElement>pElement;
pElement=pDisp;
pElement->put_value(CString("123").AllocSysString());
}