m_spWebBrowser2->get_HWND((long *)&pHWND);
连当前IE的句柄也取不到?

解决方案 »

  1.   

    pHWND 是什么?HWND *?
      

  2.   

    HWND m_hwndOther = FindWindowExA(NULL,NULL,"IEFrame",NULL);
    if(m_hwndOther == NULL)
    {
    m_hwndOther = FindWindowExA(NULL,NULL,"CabinetWClass",NULL);
    if(m_hwndOther == NULL)
    {
    m_hwndOther = FindWindowExA(NULL,NULL,"ExploreWClass",NULL);
    }
    }
    if(m_hwndOther == NULL)
    return NULL; m_hwndOther = FindWindowExA(m_hwndOther,NULL,"WorkerW",NULL);
    if(m_hwndOther == NULL)
    return NULL; m_hwndOther = FindWindowExA(m_hwndOther,NULL,"ReBarWindow32",NULL);
    if(m_hwndOther == NULL)
    return NULL; return FindWindowExA(m_hwndOther,NULL,"ComboBoxEx32",NULL);