 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
edo Guest
|
Posted: Thu Dec 11, 2003 11:12 pm Post subject: how to get each ACTIVE instance of MS-IE |
|
|
Hello,
I'm trying to find out a way to get all of the ACTIVE instances of MS-IE,
and then get the active html-body of each.
the following code works fine for a NEW instance:
procedure TForm1.Button1Click(Sender: TObject);
var
IE, Doc, Bod, V: Variant;
begin
IE := CreateOleObject('InternetExplorer.Application');
IE.Navigate('www.borland.com', V, V, V, V);
IE.Visible := false;
while IE.Busy do sleep(0);
Doc := IE.Document;
Bod := Doc.Body;
memo1.Lines.Text:=Bod.InnerHTML;
end;
but, as i said, i need to do the same with ALL of the already opened IE
windows....
i tried,
IE := GetActiveOleObject('InternetExplorer.Application');
it did not work, and anyway i do not see how this can help me get ALL of the
opened IEs.
BTW, i also need to do the same with Netscape and Opera.... i guess they
also have OLE objects, right? does anyone has a link to their interface
documentation?
thanks in advance for any help.
edo.
|
|
| Back to top |
|
 |
Avatar Zondertau Guest
|
Posted: Mon Jan 05, 2004 7:20 pm Post subject: Re: how to get each ACTIVE instance of MS-IE |
|
|
| Quote: | I'm trying to find out a way to get all of the ACTIVE instances of MS-IE,
and then get the active html-body of each.
IE := GetActiveOleObject('InternetExplorer.Application');
it did not work, and anyway i do not see how this can help me get ALL of
the
opened IEs.
BTW, i also need to do the same with Netscape and Opera.... i guess they
also have OLE objects, right? does anyone has a link to their interface
documentation?
|
What you want to do with IE is probably possible using the
GetRunningObjectTable funtion (see
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/cmf_d2l_38md.asp)[/url]. I
am rather certain though that nothing like this is possible for Netscape and
Opera. I don't know for these browsers themselves, but Mozilla, which is a
lot like Netscape, does not use OLE. This is because Mozilla uses XPCOM
instead of the normal Microsoft COM for platform independance. XPCOM is not
supported by Delphi, but a COM to XPCOM wrapper is available. The problem
is, that this is not installed by default and something like this may not
even available for Netscape. For Opera i don't know, but it's probably a lot
like the Mozilla situation as well.
I would be looking for a different approach if i were you. Perhaps it is
possible to do something like this with plugins, but you would have to make
one for every browser. But if indeed all you need to know is the html in the
browser you could also write a local proxy server, which is very easy to do
using Indy. If you then set the proxy server for each installed browser to
the address of your proxy, your app will do all downloading and it can see
(and even change) all HTML code coming to the browser.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|