Does the sendmessage function in the browser focus input box?

Source: Internet
Author: User
Does the sendmessage function in the browser focus input box? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061115123755228.html
Use sendmessage (getfocus, wm_settext, 0, longint (pchar ('20140901 ')));
The current focus is an input box of the browser. It is found that the value of the input box is not changed, but the title of IE is changed.
The same method is effective for other interfaces. How can this problem be solved?

Make webbrowser focus:

Uses mshtml;

(Webbrowser1.document as ihtmldocument2). parentwindow. focus;

Not webbrowser or browser

Obtain the window handle of IE browser, obtain the ihtmldocument2 interface, and then use the. parentwindow. Focus method to get the focus.

Old Demon:
Currently, the focus is already on the input box, but sendmessage cannot be used to assign values to the input box (I learned that the input box on the webpage does not contain hwnd)
The purpose of parentwindow. Focus is to put the focus on the input box? Please also express it!

If you canCodeI am very grateful for posting this article!

The control on the browser is different from that on the common control. The above control is dynamically generated by code locally. You cannot simply call the API and use the interface provided by the browser.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.