代码:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ShdocVW, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
var
xWin:IShellWindows;
xWeb:IWebbrowser;
i:Integer;
begin
xWin:=CoShellWindows.Create;
for i:=0 to xWin.Count-1 do begin
xWeb:=xWin.Item(i) as IWebbrowser;
ListBox1.Items.Add(xWeb.LocationURL);
end;
end;end.
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ShdocVW, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
var
xWin:IShellWindows;
xWeb:IWebbrowser;
i:Integer;
begin
xWin:=CoShellWindows.Create;
for i:=0 to xWin.Count-1 do begin
xWeb:=xWin.Item(i) as IWebbrowser;
ListBox1.Items.Add(xWeb.LocationURL);
end;
end;end.
解决方案 »
- 如何使用Delphi实现对“服务”的重新启动(象Officescan,SQL Server的服务)
- 闲来没事写了一个CSDN帖子搜索工具
- 谁有delphi6网络编程一书的代码????????????
- [跪求]兄弟们救救我,一个简单的数据库登陆系统!!!
- 请教FRREPORT的设计问题?
- 我在书中看到一句程序不明?请大家帮忙!!! a为int64型, 为什么会出现a:=a or (1 shl I)??
- 怎么获得DateTimePicker控件里面的日期?
- 送分题!
- 请问各位大虾,dxdbgrid怎样读取每一组的统计值,非常紧急,在线等!!!
- 酒店管理系统的源代码,谁想要! [email protected]
- 如何减少重复劳动?
- 急啊,关于richedit
Function GetURL(H:hwnd;lparam:longint):boolean;stdcall;
var str,url:array [0..254] of char;
begin
getclassname(h,@str,255);
if strpas(@str)='ComboBoxEx32' then // ComboBoxEx32可以改成Edit.
begin
SendMessage(h,WM_GETTEXT,255,LongInt(@url));
form1.ListBox1.Items.Add(strpas(@url));
end;
result:=true;
end;
function callbackproc(H:HWnd;lparam:longint):Boolean;stdcall;
var str:array [1..255] of char;
begin
getclassname(h,@str,255);
if ((strpas(@str)='CabinetWClass') or (strpas(@str)='IEFrame')) then
begin
Enumchildwindows(h,@GetURL,0);
end;
result:=true;
end;procedure TForm1.findbuttonClick(Sender: TObject);
begin
listbox1.Clear;
Enumwindows(@callbackproc,0);
end;
var
DDE: TDdeClientConv;
begin
DDE := TDdeClientConv.Create(self);
if DDE.SetLink('IExplore','WWW_GetWindowInfo' ) then
Label1.Caption := DDE.RequestData( '0xFFFFFFFF, sURL, sTitle' )
else
ShowMessage( 'IE is not running' );
DDE.Free;end;