如何向IE浏览器的网址输入栏,自动填入网址啊?具体的,最好有个代码,

解决方案 »

  1.   

    找到Edit句柄,发送WM_SETTEXT。但是IE这么多版本,找句柄的方法得区别对待
      

  2.   

    http://topic.csdn.net/u/20120319/17/95a94902-fc3e-44e5-8798-c24bfcb10a00.html?75359
      

  3.   

    据说autoit可以实现,有人会写吗?
      

  4.   

    autoit估计是模拟按键,如果这样的话,倒是简单了!
    写一个.vbs文件:
    Set oIE = GetObject("", "InternetExplorer.Application")
    oIE.Visible = True
    Set oShell = GetObject("", "WScript.Shell")
    oShell.AppActivate "Internet Explorer"
    oShell.SendKeys "%d"
    WSH.Sleep 100
    oShell.SendKeys "http://www.sina.com.cn"Set oShell = Nothing
    Set oIE = Nothing
    模拟按键不准,因为某些极端时候活动窗体可能是其他窗体,这样的话按键是对应于那个窗体的,就不准了!
      

  5.   

    Delphi的:
    uses ComObj;procedure TForm1.Button1Click(Sender: TObject);
    var
      V: Variant;
    begin
      V := CreateOleObject('InternetExplorer.Application');
      V.Visible := True;
      V := Unassigned;
      V := CreateOleObject('WScript.Shell');
      V.AppActivate('Internet Explorer');
      V.SendKeys('%d');
      Sleep(100);
      V.SendKeys('http://www.sina.com.cn');
      V := Unassigned;
    end;