Steve,
It's possible. The first thing you have to do is find the running
instance of internet explorer (I don't know how you would do it for other
browsers). Knowledge base article 176792 titled "How To Connect to a
Running Instance of Internet Explorer" tells you how to do this. You can
find it here (watch for line wrap):
http://support.microsoft.com/kb/176792/EN-US/
The example is for VB6, but it's easy enough to convert it to .NET.
Once you have that, you have access to the browser, and the object
model of the document in the browser. Finding your javascript code an
executing it (through the document object model) is a breeze after that.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
SteveS said:
What would you like to know? Maybe an example will help:
Let's say we have a web page with a javascript function called
"Hello(name)"
The function takes the variable "name" and pops the value up in an alert
box.
Then in a windows app, I have a form with a textbox and a button.
I want to be able to enter a value into the textbox located on the form
and
when I press the button, have the value passed directly into the
javascript
function located in the web page.
Couple of caveats:
1) This is a standalone instance of a browser - not a browser embedded in
another app
2) I would like to invoke the javascript directly (i.e. No page refresh
due
to GET/POST)
Am I dreaming? Can this be done?