uses DDEman,ShellAPI,ComObj; var DDE:TDDEClientConv; //DDE是全局变量......procedure TForm1.Button1Click(Sender: TObject); begin if DDE.SetLink( 'Iexplore', 'WWW_GetWindowInfo' ) then //设置会话连接成功 begin DDE.OpenLink; Edit1.Text := DDE.RequestData('-1'); //返回信息并在Edit1中显示 DDE.CloseLink; end else ShowMessage( 'IE没有运行!' );end;说名: 就几个控件,你自己看吧!
var DDE:TDDEClientConv; //DDE是全局变量......procedure TForm1.Button1Click(Sender: TObject);
begin
if DDE.SetLink( 'Iexplore', 'WWW_GetWindowInfo' ) then
//设置会话连接成功
begin
DDE.OpenLink;
Edit1.Text := DDE.RequestData('-1');
//返回信息并在Edit1中显示
DDE.CloseLink;
end
else
ShowMessage( 'IE没有运行!' );end;说名:
就几个控件,你自己看吧!
p:pchar;
h:thandle;
begin
h:=FINdwindow('IEFRAME',nil);
getmem(p, GetWindowTextLength(h));
GetWindowText(h,p, GetWindowTextLength(h));
caption:=strpas(p);
end;
这样我试过,似乎有时候会返回句柄0! 好像不妥,有什么其他解决方案吗?