例如:我想向IE的地址栏中输入www.ynceo.cn~~~~~

解决方案 »

  1.   

    使用OLE控制IE
    unit ligwin1;interfaceuses  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,  ExtCtrls, ComCtrls, StdCtrls,ComObj, Shellapi; type  TForm1 = class(TForm)  Button1: TButton;  Button2: TButton;  procedure Button1Click(Sender: TObject);  procedure FormCreate(Sender: TObject);  procedure Button2Click(Sender: TObject);  private  { Private declarations }  app:Variant;  public  { Public declarations }  end; var  Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject);begin try  app.Navigate('c:\chih_com\index.html');  app.Visible:=TRUE; except  //on EOleSysError do MessageBox(0,'EOleSysError','提示信息',MB_OK);  app:=CreateOleObject('InternetExplorer.Application');  app.Navigate('c:\chih_com\index.html');  app.Visible:=TRUE; end;end; procedure TForm1.FormCreate(Sender: TObject);begin app:=CreateOleObject('InternetExplorer.Application');end; procedure TForm1.Button2Click(Sender: TObject);begin try  app.Navigate('c:\chih_com\index.html',1);  app.Visible:=TRUE; except  app:=CreateOleObject('InternetExplorer.Application');  app.Navigate('c:\chih_com\index.html');  app.Visible:=TRUE; end;end; end.
      

  2.   

    findwindow enumchildwindow等等函数 
    找到地址栏的窗体句柄
    SendMessage( hwnd, WM_TEXT,...
      

  3.   

    findwindow enumchildwindow等等函数 
    找到地址栏的窗体句柄
    SendMessage( hwnd, WM_TEXT,...同意~~~~~~~~~~
      

  4.   

    先找到ie窗體的 findwidow(pchar('IEframe'),'標題');
    然後再Enumchildwindows(ie句柄,@回調函數名稱,‘你定義的變量’)找到地址欄,
    最後sendmessage()