再问如何跟踪IE的地址栏?注:需使用COM方式实现(500分) (0分)

  • 主题发起人 主题发起人 lingxin
  • 开始时间 开始时间
L

lingxin

Unregistered / Unconfirmed
GUEST, unregistred user!
我需要写一个程序跟踪IE。具体的是从所有打开的IE窗口中得到地址。
特别注明需使用com方式实现。
500分将在有答案后给。

另:请不要乱灌水
 

var
ShellWindow: IShellWindows;
nCount: integer;
spDisp: IDispatch;
i: integer;
vi: OleVariant;
IE1: IWebBrowser2; //IE这里是源代码:

begin
ShellWindow := CoShellWindows.Create;
nCount := ShellWindow.Count;
for i := 0 to nCount - 1 do
begin
vi := i;
try
spDisp := ShellWindow.Item(vi);
except exit end;
if (spDisp<>nil) then
begin
try
begin
spDisp.QueryInterface( iWebBrowser2, IE1 );
end
except
on EAccessViolation do begin exit end;
end;
if (IE1 <> nil) then
begin
Log.Lines.add( 'LocationUrl: ' + IE1.Get_LocationURL());
end;
end;
end;
 
huli 能否将该例子写全
谢谢
 
这是您说的500分啊 :)简直是掉馅饼
http://www.intelligo.net/iedelphi/
下载bho控件,另看它的说明,绝对解决问题!
IEHELPER demonstrates how to create and register
a Browser Helper Object in Delphi, and how to
establish a two-way communication between IE and the Helper Object.

 
编译例子前一定要看它的Getting Started目录,否则会出错!
 
hi g622
你好,我用DDE已经能实现这个功能。只要几行代码就行了。
现在想用com方式实现。
那个bho我早已试过,不能满足我的要求。很抱歉。
但还是要谢谢你。

 
不能从所有打开的IE窗口中得到地址吗?不可能啊
 
to g622:
编译例子前一定要看它的Getting Started目录,否则会出错
Getting Started什么意思,是不是SHDOCVW_TIB.dcu没找到的错误,如何解决?
 
Remove the default "Internet Explorer Components" package.
You can install the new components in two ways:
1) choose from the menu Component->Import ActiveX Control and install:
Microsoft HTML Object Library
Microsoft Internet Controls
this will install:
Webbrowser_V1
Webbrowser
Scriptlet
but will not install additional components on Server-Tab.
2) Go to your Windows/System directory and execute:
tlibimp shdocvw.dll
Following files are created:
shdocvw_tlb.pas
shdocvw_tlb.dcr
Move these files to Delphi5/Import or somewhere else in your Delphi search-path.
Execute the following command in Windows/System directory:
tlibimp mshtml.tlb
It may take a couple of minutes before the following files are created:
mshtml_tlb.pas
mshtml_tlb.dcr
Move these files to Delphi5/Import or somewhere else in your Delphi search-path.
Create a new package "IE50.DPK" and add shdocvw_tlb.pas and mshtml_tlb.pas. Compile
and install. You can also add Embeddedwb and other components from this website to the package.
In addition to
Webbrowser_V1
Webbrowser
shdocvw_tlb.pas will add 4 useful components to Servers-Tab:
TInternetExplorer, TShellWindows, TShellUIHelper, TShellFavoritesNameSpace.
mshtml_tlb.pas will add approx. 100 components to Servers-Tab. Some of them
are very useful and some of them useless. You can edit mshtml_tlb.pas and
select the components you find useful and recompile the package.
Remember to update the files when you upgrade your version of Internet
Explorer.
You are now ready to install EmbeddedWB and other components from this
website in Delphi 5.
 
用DDE是怎么实现的,能把source code贴出来吗?
 
接受答案了.
 
后退
顶部