<9i************ *@jetable.orgwr ote in message
news:11******** *************@e 16g2000pri.goog legroups.com
I'm trying to add a button to the IE toolbar, and on the click of the
button open a popup window with a remote URL. Secondly, I'm trying to
highlight certain predefined words on particular web sites through the
IE plugin itself.
To add an IE button, I've found this neat article:
http://www.codeproject.com/useritems...EExtension.asp
But I'm stuck with two things:
1. How to open a popup window (IE instance) on the click of the
button? The article above doesn't mention it.
The article shows a button that runs an executable when clicked. An IE
toolbar button may also be backed by script, or by a COM object. For
details, see
http://msdn2.microsoft.com/en-us/library/aa753588.aspx
In all three cases, you can create a new standalone instance of IE with
CoCreateInstanc e(CLSID_Interne tExplorer) (in case of JavaScript, that
would be new ActiveX("Intern etExplorer.Appl ication"); in case of
VBScript, CreateObject("I nternetExplorer .Application") ). There should
be a .NET equivalent, but I don't know what it is off the top of my
head.
A script can also use window.open, just like the script on the page
would.
A COM object can use an equivalent to window.open. It also can call
IWebBrowser2::N avigate with navOpenInNewWin dow flag.
2. How can I include some JavaScript code in the "plugin", so that it
executes some JavaScript code on particular pages (much like the
Greasemonkey extension for Firefox)?
When you create a toolbar button, you have an option of setting it up to
run a piece of JavaScript when clicked. Is this what you have in mind?
If you want your plugin to work automatically without user intervention,
then toolbar button is a wrong type of extension to implement. You want
a browser helper object (BHO):
http://msdn2.microsoft.com/en-us/library/bb250436.aspx
BHOs can only be implemented as COM components, you can't write one with
script.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925