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.