如何获得Internet Explorer
答案:2 悬赏:50
解决时间 2021-03-14 14:49
- 提问者网友:饮鸿
- 2021-03-14 00:59
如何获得Internet Explorer
最佳答案
- 二级知识专家网友:废途浑身病态
- 2021-03-14 01:08
#include
HWND GetHwndFromIWebBrowser2(IWebBrowser2* pWebBrowser2)
{
if (pWebBrowser2 == NULL)
return NULL;
IServiceProvider* pServiceProvider = NULL;
//1. --Shell Embedding
if (SUCCEEDED(pWebBrowser2->QueryInterface(
IID_IServiceProvider,
(void**)&pServiceProvider)))
{
IOleWindow* pWindow = NULL;
if (SUCCEEDED(pServiceProvider->QueryService(
SID_SShellBrowser,
IID_IOleWindow,
(void**)&pWindow)))
{
HWND hwndBrowser = NULL;
if (SUCCEEDED(pWindow->GetWindow(&hwndBrowser)))
{
//2.|-Shell DocObject View
HWND hchildwnd = GetWindow(hwndBrowser, GW_CHILD);
while (hchildwnd)
{
TCHAR wndname[MAX_PATH] = _T("");
GetClassName(hchildwnd, wndname, MAX_PATH);
if ( wcscmp(wndname,_T("Shell DocObject View")) == 0 )
{
//3.|--Internet Explorer_Server
HWND hiewnd = GetWindow(hchildwnd, GW_CHILD);
while (hiewnd)
{
TCHAR wndname[MAX_PATH] = _T("");
GetClassName(hiewnd, wndname, MAX_PATH);
if ( wcscmp(wndname,_T("Internet Explorer_Server")) == 0 )
{
return hiewnd;
}
hiewnd = GetNextWindow(hiewnd, GW_HWNDNEXT);
}
return hwndBrowser;
}
hchildwnd = GetNextWindow(hchildwnd, GW_HWNDNEXT);
}
return hwndBrowser;
}
pWindow->Release();
}
pServiceProvider->Release();
}
return NULL;
}
HWND GetHwndFromIWebBrowser2(IWebBrowser2* pWebBrowser2)
{
if (pWebBrowser2 == NULL)
return NULL;
IServiceProvider* pServiceProvider = NULL;
//1. --Shell Embedding
if (SUCCEEDED(pWebBrowser2->QueryInterface(
IID_IServiceProvider,
(void**)&pServiceProvider)))
{
IOleWindow* pWindow = NULL;
if (SUCCEEDED(pServiceProvider->QueryService(
SID_SShellBrowser,
IID_IOleWindow,
(void**)&pWindow)))
{
HWND hwndBrowser = NULL;
if (SUCCEEDED(pWindow->GetWindow(&hwndBrowser)))
{
//2.|-Shell DocObject View
HWND hchildwnd = GetWindow(hwndBrowser, GW_CHILD);
while (hchildwnd)
{
TCHAR wndname[MAX_PATH] = _T("");
GetClassName(hchildwnd, wndname, MAX_PATH);
if ( wcscmp(wndname,_T("Shell DocObject View")) == 0 )
{
//3.|--Internet Explorer_Server
HWND hiewnd = GetWindow(hchildwnd, GW_CHILD);
while (hiewnd)
{
TCHAR wndname[MAX_PATH] = _T("");
GetClassName(hiewnd, wndname, MAX_PATH);
if ( wcscmp(wndname,_T("Internet Explorer_Server")) == 0 )
{
return hiewnd;
}
hiewnd = GetNextWindow(hiewnd, GW_HWNDNEXT);
}
return hwndBrowser;
}
hchildwnd = GetNextWindow(hchildwnd, GW_HWNDNEXT);
}
return hwndBrowser;
}
pWindow->Release();
}
pServiceProvider->Release();
}
return NULL;
}
全部回答
- 1楼网友:风格单纯
- 2021-03-14 02:30
internet explorer 8 rc1够新了吧.. 32-bit vista & windows server 2008 <a href="http://wenwen.soso.com/z/urlalertpage.e?sp=shttp%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3fdisplaylang%3dzh-cn%26familyid%3d8e31391b-91b2-40c4-8643-7b70d1d5628b" target="_blank">http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&familyid=8e31391b-91b2-40c4-8643-7b70d1d5628b</a> 64-bit vista & windows server 2008 <a href="http://wenwen.soso.com/z/urlalertpage.e?sp=shttp%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3fdisplaylang%3dzh-cn%26familyid%3d9ae59654-
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯