Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3438190
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:09:25+00:00 2026-05-18T08:09:25+00:00

Using MSHTML I’d like to set the user focus on a text element, what

  • 0

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 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:09:26+00:00Added an answer on May 18, 2026 at 8:09 am
    CComQIPtr<IHTMLElement2 > element2(field);
    if(element2!=NULL) element2->focus();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to set entire HTML in MSHTML? I am trying using this assignment: (Document
In C#, I am using the mshtml.HTMLDocument to retrieve various elements from a page.
I am constructing an <li> element like this: var element = $(<li></li>) .html(mHTML) .attr('id',
I am using the mshtml namespace to access DOM elements as returned by a
I have been using PHP for a long time, but I want to move
I've just installed ie9 and now my program using mshtml's IHTMLStyle no longer can
i'm using the mshtml dll to develop a helper to ie, i'm trying to
I'm using the MSHTML API from C# 4.0 and the logistics of running code
I'm using C#, MSHTML and InternetExplorer objects to run through a webpage, but I'm
using SQL server 2005+ for over a year now, I've been running a query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.