Using MSHTML I’d like to set the user focus on a text element, what I’ve been given and tried so far doesn’t work.
CComPtr<IHTMLInputTextElement> field;
field->put_value( .. ); // I have the right element as I can set the text...
VARIANT vStatus;
vStatus.vt = VT_BOOL;
vStatus.boolVal = VARIANT_TRUE;
field->put_status(vStatus);
CComQIPtr<IHTMLInputElement> inputElement(field);
if( inputElement )
inputElement->put_status(VARIANT_TRUE);
and by doesn’t work I mean it runs and reports no errors but the focus on the web page doesn’t change.
1 Answer