下面是用IE4实现的,我没有IE5,不过你只要用winsight看看IE5的几个类名就可以了.
var wnd:hwnd;
URL:string;
begin
wnd:=findwindow('CabinetWClass',nil);
wnd:=findwindowex(wnd,0,'Worker',nil);
wnd:=findwindowex(wnd,0,'ReBarWindow32',nil);
wnd:=findwindowex(wnd,0,'ComboBoxEx32',nil);
wnd:=findwindowex(wnd,0,'ComboBox',nil);
wnd:=findwindowex(wnd,0,'Edit',nil);
if wnd<>0 then
begin
URL:='http://www.gislab.ecnu.edu.cn/delphibbs';
sendmessage(wnd, WM_SETTEXT, length(URL), longint(pchar(URL)));
end;
BTW:奇怪的是,反过来却不行,无法用WM_GETTEXT得到地址栏的内容.