你建一个类,基于HttpServer类,在类里设一个成员函数,处理你输入的
字符,再用消息映射
ON_PARSE_COMMAND
ON_PARSE_COMMAND_PARAMS
这个你自己去查msdn,里面说得很清楚
HttpServer就是专门处理网页与后台的通信。

解决方案 »

  1.   

    转贴:
    先获得窗口句柄; m_hProgram=FindWindow(NULL,"certan program "); 
    得到某一控件句柄; m_hEdit=CWnd::FromHandle(FindWindowEx(m_hProgram->GetSafeHwnd(),NULL,"EDIT",NULL));
      

  2.   

    IE窗口中的INPUT是没有句柄的。
      

  3.   

    save the following in a html file, use IE to open it
    <html>
    <body>
    a test input field<BR>
    <input type=TEXT id=input1 name=input1>
    </body>
    </html>
      

  4.   

    #include "stdafx.h"
    #import <mshtml.tlb> // Internet Explorer 5
    #import <shdocvw.dll>
    #include "Shlwapi.h"
    #pragma comment(lib,"Shlwapi.lib")
    int _tmain(int argc, _TCHAR* argv[])
    {
    CoInitialize(NULL);
    SHDocVw::IShellWindowsPtr m_spSHWinds;
    if(m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) == S_OK)
    {
    IDispatchPtr spDisp;
    long nCount = m_spSHWinds->GetCount();
    for (long i = 0; i < nCount; i++)
    {
    _variant_t va(i, VT_I4);
    spDisp = m_spSHWinds->Item(va);
    SHDocVw::IWebBrowser2Ptr spBrowser(spDisp);
    if (spBrowser != NULL)
    {
    IDispatchPtr spDisp;
    if(spBrowser->get_Document(&spDisp) == S_OK && spDisp!= 0 )
    {
    MSHTML::IHTMLDocument2Ptr spHtmlDocument(spDisp);
    MSHTML::IHTMLElementPtr spHtmlElement;
    if(spHtmlDocument==NULL)
    continue;
    spHtmlDocument->get_body(&spHtmlElement);
    if(spHtmlDocument==NULL)
    continue;
    HRESULT hr;
    MSHTML::IHTMLElementCollection* pColl=NULL;
    hr=spHtmlDocument->get_all(&pColl);
    if(pColl!=NULL&&SUCCEEDED(hr))
    {
    long lcount = 0;
    pColl->get_length(&lcount);
    for(int i=0;i<lcount;i++)
    {
    _variant_t index;
    index.vt=VT_I4;
    index.intVal=i;
    IDispatchPtr disp;
    disp=pColl->item(index,index);
    if(disp==NULL)
    hr=E_FAIL;
    else
    {
    MSHTML::IHTMLInputElementPtr pInput(disp);
    if(pInput)
    {
    BSTR bstrtype;
    pInput->get_type(&bstrtype);
    printf(_bstr_t(bstrtype));
    if(StrCmpW(bstrtype,L"text")==0)
    {
    pInput->put_value(_bstr_t("fill it"));
    printf("fill a field\n");
    }
    SysFreeString(bstrtype);
    }
    } }
    pColl->Release();
    }
    } }
    } }
    else 
    {
    printf("Shell Windows interface is not avilable\n");
    }
    CoUninitialize();
    return 0;
    }
    You are suggested to use a more meaningful caption.
    http://www.csdn.net/expert/topic/570/570255.xml?temp=.8447229 提问的智慧
    http://www.csdn.net/expert/topic/600/600260.xml?temp=.4702722 发贴的建议
      

  5.   

    modify html page of IE via DHTML modal.
      

  6.   

    我再说一下我要实现的程序的功能:
    对WEB页上的一个输入域,比如我想写一个100进去,只要运行我的程序,在输入域中点鼠标右键,选个菜单后,就把100填到了那个输入域中了。
    那个输入域是别的应用程序时(指当它不是WEB页上的输入时也能实现如上功能)如何实现。谢谢各位,快帮帮我!
      

  7.   

    http://www.vckbase.com/document/viewdoc.asp?id=183
    VCKBASE上有一个这样的例子