cgrandgent
asked on
how to paste into browser control Find box, or pre-stuff it with search string ?
I have launched a Find box for a IWebBrowser2 control via ExecWB(OLECMDID_FIND...... ..
I have copied the search string to the clipboard, and wish to paste it into the Find box (a better alternative would be to specify the search string at ExecWB time).
I have enumerated the windows and located the window so I could make sure it has focus.
It apparently is maybe CDHtmlDialog and not a regular text window.
If from the keyboard I do CTL-V or right-click and select "paste", it pastes in OK, but doing it via keybd_event() or SendInput() doesn't do the trick, nor does SendMessage(hwnd,WM_PASTE, 0,0).
How to work this magic ?
I have copied the search string to the clipboard, and wish to paste it into the Find box (a better alternative would be to specify the search string at ExecWB time).
I have enumerated the windows and located the window so I could make sure it has focus.
It apparently is maybe CDHtmlDialog and not a regular text window.
If from the keyboard I do CTL-V or right-click and select "paste", it pastes in OK, but doing it via keybd_event() or SendInput() doesn't do the trick, nor does SendMessage(hwnd,WM_PASTE,
How to work this magic ?
ASKER
OK, a little further.
I got the HTML from the Find box and stuck it here: http://www.chuckg.com/find.htm
If you look at the source for that page, you'll see I need to set the focus for
<INPUT id=txtFindText
and then paste what I have on the clipboard in there.
Still looking for someone who give me a pointer how.
I got the HTML from the Find box and stuck it here: http://www.chuckg.com/find.htm
If you look at the source for that page, you'll see I need to set the focus for
<INPUT id=txtFindText
and then paste what I have on the clipboard in there.
Still looking for someone who give me a pointer how.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
From the code at http://support.microsoft.com/kb/249232 I have been able to derive the IHTMLDocument2 for the Find box from the HWND that I got by enumerating the windows. From that I've been able to get as far as getting the text from the Find box:
InnerText = 0x024ff324 "Find:
Match whole word only Match case
PreviousNext "
Now, how to insert the text I have on the clipboard into this document element ?
Open in new window