IHTMLDocument

mac2022-06-30  21

HRESULT CMyWebBrowserDlg::OnButtonCancel(IHTMLElement* pElement) { //Navigate(_T("http://www.baidu.com")); CString url; GetCurrentUrl(url); CComPtr<IHTMLInputElement> BtnOK; GetElementInterface(_T("TestButton"), IID_IHTMLInputElement, reinterpret_cast<void**>(&BtnOK)); if (BtnOK) { IHTMLElement* pControl = NULL; BtnOK->QueryInterface(IID_IHTMLElement, (void**)&pControl); pControl->click(); pControl->Release(); IHTMLControlElement* pControl2 = NULL; BtnOK->QueryInterface(IID_IHTMLControlElement, (void**)&pControl2); pControl2->focus(); pControl2->Release(); //CComBSTR value; //BtnOK->get_value(&value); //if (value == L"确定") // BtnOK->put_value(L"取消"); //else // BtnOK->put_value(L"确定"); } //OnCancel(); return S_OK; }

 

转载于:https://www.cnblogs.com/Forest-zhu/archive/2011/12/28/2304774.html

相关资源:C#获得IHTMLDocument2并且创建链接的单击事件
最新回复(0)