Post by JayIs there a way to, once the browser is open, to make my
programs output different keystrokes (Tab, Enter, letters
and numbers) to make the cursor navigate around the
browser?
Not easily.
The simpliest way to do it is to just blindly issue keystrokes with the
keydb_event() function. But then you lose control over where those
keystrokes get delivered. If you want them to be directed to the browser
window specifically, then you need direct access to the HWND for it so you
can send WM_CHAR and WM_KEYUP/DOWN messages to it. You will have to hunt
for that HWND manually before you can then do anything with it, though.
Another option would be to not run the browser separately. If you use the
TCppWebBrowser component (which is a wrapper around IE's ActiveX control),
then you have direct access to a browser window as you are hosting in your
own application itself, and can thus manipulate it as needed. But then you
are no longer using the user's default browser (which may not be IE).
Post by JayI open www.yahoo.com, the cursor is in the search field
Not always. That depends on whether the user has scripting enabled or not.
Even then, I find that many times, it still doesn't work very often. I
usually have to click on the field manually in order to put focus on it.
Post by JayIf I hit the enter key, the search process begins.
You don't have to focus the search button in order to submit the search
form. Pressing Enter on any of the edit fields will do that. Or, if you
are using the IHTMLDocument2 interface, then you can retreive the
IHTMLFormElement interface for the search form and then call its submit()
method.
Gambit