我用了下面一些方法,都没成功::SendMessage(hEdit,WM_KEYDOWN ,VK_DOWN,0X0D);//发送下键按下的消息
::SendMessage(hEdit,WM_KEYDOWN ,VK_UP,0X0D);//发送下键按下的消息::PostMessage(hWorker,WM_CHAR,::MapVirtualKey(VK_F5,0),0); //刷新 

解决方案 »

  1.   

    拜托
    你再发送一个VK_ENTER吧
      

  2.   

    u should get the handle of the combobox
    then set the URL
    then simulate a keydown message (press the enter)
      

  3.   

    ::SendMessage(hEdit,WM_CHAR ,::MapVirtualKey(VK_RETURN,0),0);
    ::SendMessage(hcom,WM_CHAR ,::MapVirtualKey(VK_RETURN,0),0);都发了,还是不行,老兄,试一下看看
    HWND hWorker,hRebar,hComEx,hcom,hEdit;
    HWND hwndParent=::FindWindow("IEFrame",NULL);//找到IE窗口---最近一次查看的哪个ie

    char szError[260]="c:\\AA20.HTM";

    hWorker=FindWindowEx(hwndParent,0,"WorkerA",NULL);//找到工作区窗口(不是internet explorer server窗口)
    if(hWorker == NULL)//用户用NT
    hWorker=FindWindowEx(hwndParent,0,"WorkerW",NULL);//WindowNT中的ie

    hRebar=FindWindowEx(hWorker,0,"ReBarWindow32",NULL);//找到Rebar窗口

    hComEx=FindWindowEx(hRebar,0,"ComboBoxEx32",NULL);//找到Comboboxex
    hcom=FindWindowEx(hComEx,0,"ComboBox",NULL);//找到combobox

    hEdit=FindWindowEx(hcom,0,"Edit",NULL);//找到ComBoBox的edit控件句柄 
    //::SendMessage(hEdit,WM_GETTEXT,260,(LPARAM) szError);

    ::SendMessage(hEdit,WM_SETTEXT,260,(LPARAM) szError);
      

  4.   

     hwndParent=FindWindow("IEFrame",NULL);
    HWND hWorker,hRebar,hComEx,hcom,hEdit;
    char szURL[100]="http://www.netease.com";
    HWND hwndParent;  
    hWorker=FindWindowEx(hwndParent,0,"WorkerA",NULL);
    if(hWorker == NULL)
    hWorker=FindWindowEx(hwndParent,0,"WorkerW",NULL);
    hRebar=FindWindowEx(hWorker,0,"ReBarWindow32",NULL);
    hComEx=FindWindowEx(hRebar,0,"ComboBoxEx32",NULL);
    hcom=FindWindowEx(hComEx,0,"ComboBox",NULL);
    hEdit=FindWindowEx(hcom,0,"Edit",NULL);
    SendMessage(hEdit,WM_SETTEXT,100,(LPARAM) szURL);
    //回车
    SendMessage(hEdit,WM_KEYDOWN,VK_RETURN,0X0D);
    SendMessage(hEdit,WM_KEYUP,VK_RETURN,0X0D);