HRESULT CTryData4Dlg::OnMouseOverOnce(IHTMLElement *phtmlElement) { if(m_State == RUNNING) return S_OK; if(m_sDataSel.Find("测量结果") < 0) return S_OK; CString sel = this->GetAttribute(phtmlElement,m_elemTypes[2]); if(sel.IsEmpty() || sel[0] != 'Z') return S_OK; m_sDataUrl = this->GetAttribute(phtmlElement,m_elemTypes[4]); // if(m_sDataUrl.FindOneOf("0123456789") < 0) return S_OK; IHTMLStyle *phtmlStyle; phtmlElement->get_style(&phtmlStyle); if (phtmlStyle) { CString retest("单击测量"); phtmlElement->put_innerText(retest.AllocSysString()); VARIANT varColor; varColor.vt = VT_I4; varColor.lVal = 0x990033; phtmlStyle->put_backgroundColor(varColor); phtmlStyle->put_textDecorationUnderline(VARIANT_TRUE); // phtmlStyle->put_color(varColor); phtmlStyle->put_cursor(L"hand"); phtmlStyle->Release(); } m_spCurrElement = phtmlElement; return S_OK; }
HRESULT CTryData4Dlg::OnMouseOverUrl(IHTMLElement *phtmlElement) { CString id=GetAttribute(phtmlElement,m_elemTypes[2]); IHTMLStyle *phtmlStyle; phtmlElement->get_style(&phtmlStyle); if (phtmlStyle) { VARIANT varColor; varColor.vt = VT_I4; if(id.Find("page_") >= 0) varColor.lVal = 0x333333; else varColor.lVal = 0x330033; phtmlStyle->put_textDecorationUnderline(VARIANT_TRUE); phtmlStyle->put_color(varColor); phtmlStyle->put_cursor(L"hand"); phtmlStyle->Release(); } m_spCurrElement = phtmlElement; return S_OK; }