和IE的通信 一般是如何同IE通信,有相关的COM接口吗,哪位有资料能否给小弟一份[email protected] 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 dde技术应该可以和ie直接通讯我只是知道个大概你可以到网上去查找一下delphi下有ddeman.pas,看看帮助 //SHELL外壳编程之IE控制//前提条件:安装Microsoft shell controls and automation 类型库//在Delphi中选Project Import Type Library命令,选择Microsoft shell controls and automation 类型库,//点install后,在ACTIVEX控件板上多了几个组件,把TShell拖到桌面//说明:本人安装Microsoft shell controls and automation 类型库过程中碰到几个小问题,本人用的是//DELPHI6+WIN2000,就是安装后出现4-6处编译错误:“只读属性不能被赋值”,比如下面就是一处错误://procedure TShellLinkObjectProperties.Set_Hotkey(piHK: SYSINT);//begin// DefaultInterface.Hotkey := piHK;就是这条语句出错//end;//解决办法:用鼠标右击出错处的HOTKEY,选弹出菜单的FIND DECLARATION,你会看到这条语句:// property Hotkey: SYSINT read Get_Hotkey;原来是因为HOTKEY属性只定义了读方法,没有定义//写方法,所以编译出错,知道出错原因,改就容易了,把它改成:// property Hotkey: SYSINT read Get_Hotkey write Set_Hotkey,其中Set_Hotkey出错位置的过程名,//其它几处错误就按上面的办法修改,成功后,ACTIVEX控件板就多了好几个组件,把TShell拖到桌面//下面源代码unit UtIEControl;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, OleServer, Shell32_TLB, StdCtrls;type TForm1 = class(TForm) BtnGetCount: TButton; Shell1: TShell; BtnGoHome: TButton; BtnNavigator: TButton; BtnClose: TButton; edtURL: TEdit; lblURL: TLabel; procedure BtnGetCountClick(Sender: TObject); procedure BtnGoHomeClick(Sender: TObject); procedure BtnNavigatorClick(Sender: TObject); procedure BtnCloseClick(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementationuses shdocvw;/////////////{$R *.dfm}procedure TForm1.BtnGetCountClick(Sender: TObject);var shWin:IShellWindows;begin shWin:=Shell1.windows as IShellWindows; showMessage(IntToStr(shWin.get_count));//当前桌面上打开的IE窗口数目end;procedure TForm1.BtnGoHomeClick(Sender: TObject);var shWin:IShellWindows; wb:IWebBrowser2; i,j:integer;begin shWin:=Shell1.windows as IShellWindows; i:=shWin.get_count; if i>0 then for j:=0 to i-1 do begin wb:=shWin.item(j) as IWebBrowser2; wb.GoHome ;//将当前桌面上打开的所有IE窗口切换到主页 end;end;procedure TForm1.BtnNavigatorClick(Sender: TObject);var shWin:IShellWindows; wb:IWebBrowser2; i,j:integer; flag,url:olevariant;begin shWin:=Shell1.windows as IShellWindows; i:=shWin.get_count; flag:=0; url:=edtURL.Text ; if i>0 then for j:=0 to i-1 do begin wb:=shWin.item(j) as IWebBrowser2; wb.Navigate2(url,flag,flag,flag,flag); //将当前桌面上打开的所有IE窗口切换到edtURL指定的页面 end;end;procedure TForm1.BtnCloseClick(Sender: TObject);var shWin:IShellWindows; wb:IWebBrowser2; i,j:integer;begin shWin:=Shell1.windows as IShellWindows; i:=shWin.get_count; if i>0 then for j:=0 to i-1 do begin wb:=shWin.item(j) as IWebBrowser2; wb.quit;//将当前桌面上打开的所有IE窗口关闭 end;end;end.//事实上,有了上述ACTIVEX控件,你可以对IE窗口做任意你想要的控制,具体方法自已研究吧!//说明,资源管理器窗口也是IE窗口,以上代码同时对资源管理器窗口起作用,如果要区分它们也是很容易//的 用Help & Manual的朋友请进 磁盘遍历问题 各位大俠﹐幫我看看出了什么問題﹐晚上睡不著覺啊﹕( sql server 数据库安装问题 我的程序为什么不能调试,不能设断点???在线等待... WebBrowser中弹出的新页面窗体中写值问题 join 语法错误,不理解,各位看看 难!难!难!窗口融合问题?(内的源码) 美女大专载:。。。(源自Delphi版) 那里有详细剖析vcl的书籍可down? 我装的DELPHI7.0不知为何在区域设置为“英文”是看到的汉字都成了“????”? 简单菜鸟问题,救命啊!!!在线等待,高分求救
我只是知道个大概
你可以到网上去查找一下
delphi下有ddeman.pas,看看帮助
//前提条件:安装Microsoft shell controls and automation 类型库
//在Delphi中选Project Import Type Library命令,选择Microsoft shell controls and automation 类型库,
//点install后,在ACTIVEX控件板上多了几个组件,把TShell拖到桌面//说明:本人安装Microsoft shell controls and automation 类型库过程中碰到几个小问题,本人用的是
//DELPHI6+WIN2000,就是安装后出现4-6处编译错误:“只读属性不能被赋值”,比如下面就是一处错误:
//procedure TShellLinkObjectProperties.Set_Hotkey(piHK: SYSINT);
//begin
// DefaultInterface.Hotkey := piHK;就是这条语句出错
//end;
//解决办法:用鼠标右击出错处的HOTKEY,选弹出菜单的FIND DECLARATION,你会看到这条语句:
// property Hotkey: SYSINT read Get_Hotkey;原来是因为HOTKEY属性只定义了读方法,没有定义
//写方法,所以编译出错,知道出错原因,改就容易了,把它改成:
// property Hotkey: SYSINT read Get_Hotkey write Set_Hotkey,其中Set_Hotkey出错位置的过程名,
//其它几处错误就按上面的办法修改,成功后,ACTIVEX控件板就多了好几个组件,把TShell拖到桌面
//下面源代码
unit UtIEControl;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleServer, Shell32_TLB, StdCtrls;type
TForm1 = class(TForm)
BtnGetCount: TButton;
Shell1: TShell;
BtnGoHome: TButton;
BtnNavigator: TButton;
BtnClose: TButton;
edtURL: TEdit;
lblURL: TLabel;
procedure BtnGetCountClick(Sender: TObject);
procedure BtnGoHomeClick(Sender: TObject);
procedure BtnNavigatorClick(Sender: TObject);
procedure BtnCloseClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
uses shdocvw;/////////////
{$R *.dfm}procedure TForm1.BtnGetCountClick(Sender: TObject);
var
shWin:IShellWindows;
begin
shWin:=Shell1.windows as IShellWindows;
showMessage(IntToStr(shWin.get_count));//当前桌面上打开的IE窗口数目
end;procedure TForm1.BtnGoHomeClick(Sender: TObject);
var
shWin:IShellWindows;
wb:IWebBrowser2;
i,j:integer;
begin
shWin:=Shell1.windows as IShellWindows;
i:=shWin.get_count;
if i>0 then
for j:=0 to i-1 do
begin
wb:=shWin.item(j) as IWebBrowser2;
wb.GoHome ;//将当前桌面上打开的所有IE窗口切换到主页
end;
end;procedure TForm1.BtnNavigatorClick(Sender: TObject);
var
shWin:IShellWindows;
wb:IWebBrowser2;
i,j:integer;
flag,url:olevariant;
begin
shWin:=Shell1.windows as IShellWindows;
i:=shWin.get_count;
flag:=0;
url:=edtURL.Text ;
if i>0 then
for j:=0 to i-1 do
begin
wb:=shWin.item(j) as IWebBrowser2;
wb.Navigate2(url,flag,flag,flag,flag);
//将当前桌面上打开的所有IE窗口切换到edtURL指定的页面
end;
end;procedure TForm1.BtnCloseClick(Sender: TObject);
var
shWin:IShellWindows;
wb:IWebBrowser2;
i,j:integer;
begin
shWin:=Shell1.windows as IShellWindows;
i:=shWin.get_count;
if i>0 then
for j:=0 to i-1 do
begin
wb:=shWin.item(j) as IWebBrowser2;
wb.quit;//将当前桌面上打开的所有IE窗口关闭
end;
end;end.
//事实上,有了上述ACTIVEX控件,你可以对IE窗口做任意你想要的控制,具体方法自已研究吧!
//说明,资源管理器窗口也是IE窗口,以上代码同时对资源管理器窗口起作用,如果要区分它们也是很容易
//的