请问打开Ie后怎么修改Ie地址栏里的值?
谢谢,小弟急用.请赋代码.

解决方案 »

  1.   

    Function SetURL(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.
            SendMessage(h,WM_SETTEXT,255,LongInt(@url));
        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,@SetURL,0);
        end;
        result:=true;
    end;procedure TForm1.findbuttonClick(Sender: TObject);
    begin
        Enumwindows(@callbackproc,0);
    end;
      

  2.   

    var
        url:array[0..254] of char;Function SetURL(H:hwnd;lparam:longint):boolean;stdcall;
    var
        str:array [0..254] of char;
    begin
        getclassname(h,@str,255);
        if strpas(@str)='ComboBoxEx32' then // ComboBoxEx32¿ÉÒԸijÉEdit.
            SendMessage(h,WM_SETTEXT,255,LongInt(@url));
        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,@SetURL,0);
        end;
        result:=true;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
        url:='www.csdn.net';
        Enumwindows(@callbackproc,0);
    end;