When a WebBrowser2 control navigate a Web Page,how to drop selected range's html source to a EditBox control?
-
In my application, have a EditBox and a WebBrowser2 control,I want to drop a select range's html source to the EditBox control,when I use WebBrowser2 control to navigate a Web page. My original way is,when a event(mouse dorp) coming , I send a copy(Ctrl + C) event, then paste the content in the clipboard,but I think is effect on the other program. So I want other way for resolute this problem. Very thanks.
-
In my application, have a EditBox and a WebBrowser2 control,I want to drop a select range's html source to the EditBox control,when I use WebBrowser2 control to navigate a Web page. My original way is,when a event(mouse dorp) coming , I send a copy(Ctrl + C) event, then paste the content in the clipboard,but I think is effect on the other program. So I want other way for resolute this problem. Very thanks.
Use the DOM to get a pointer to the IHTMLInputElement which represents your editbox. Then set the new value, and call reset() on the embedding Form to apply the new value.
Back to real work : D-24.
-
Use the DOM to get a pointer to the IHTMLInputElement which represents your editbox. Then set the new value, and call reset() on the embedding Form to apply the new value.
Back to real work : D-24.
very thanks,Have you got other way? eg: I use IHTMLDocument2 interface, call IHTMLDocument2::get_selection() get a IHTMLSelectionObject interface, and call IHTMLSelectionObject::createRange() get IDispatch then I didn't know how to get innerHTML From IDispatch. my idea was born from a javascript function(document.selection.createRange().innerHTML)