//取得当前IE中地址栏信息,其它的可类推
function Tfrm_main.GetCurrentIEAddress:String;
var
  ClassName: PChar;
  atCursor: TPoint;
  hWndMouseOver: HWND;
  Text: PChar;
begin
  Result :=False;
  atCursor.x :=400;  //IE地址栏位置
  atCursor.y :=105;
  hWndMouseOver:=WindowFromPoint(atCursor);
  GetMem(ClassName, 100);
  GetMem(Text, 255);
  try
    GetClassName(hWndMouseOver, ClassName, 100);
    if String(ClassName)='Edit' then
    Begin
      SendMessage(hWndMouseOver, WM_GETTEXT, 255, LongInt(Text));
      Result :=String(Text);                                            
    end;
  finally
    FreeMem(ClassName);
    FreeMem(Text);
  end;
end;