14 个解决方案
#1
通过接口函数的参数传进去。
#2
嗯,这个晓得,关键是在js里面怎么获取当前窗口的句柄?
#3
Window Functions
The following functions are used to create and manage windows.
AdjustWindowRect
AdjustWindowRectEx
AnimateWindow
ArrangeIconicWindows
BeginDeferWindowPos
BringWindowToTop
CascadeWindows
ChildWindowFromPoint
ChildWindowFromPointEx
CloseWindow
CreateWindow
CreateWindowEx
DeferWindowPos
DestroyWindow
EnableWindow
EndDeferWindowPos
EnumChildProc
EnumChildWindows
EnumThreadWindows
EnumThreadWndProc
EnumWindows
EnumWindowsProc
FindWindow
FindWindowEx
GetClientRect
GetDesktopWindow
GetForegroundWindow
GetLastActivePopup
GetNextWindow
GetParent
GetTopWindow
GetWindow
GetWindowPlacement
GetWindowRect
GetWindowText
GetWindowTextLength
GetWindowThreadProcessId
IsChild
IsIconic
IsWindow
IsWindowUnicode
IsWindowVisible
IsZoomed
MoveWindow
OpenIcon
SetForegroundWindow
SetParent
SetWindowLong
SetWindowPlacement
SetWindowPos
SetWindowText
ShowOwnedPopups
ShowWindow
ShowWindowAsync
TileWindows
WindowFromPoint
WinMain
Obsolete Functions
AnyPopup
EnumTaskWindows
GetSysModalWindow
GetWindowTask
SetSysModalWindow
The following functions are used to create and manage windows.
AdjustWindowRect
AdjustWindowRectEx
AnimateWindow
ArrangeIconicWindows
BeginDeferWindowPos
BringWindowToTop
CascadeWindows
ChildWindowFromPoint
ChildWindowFromPointEx
CloseWindow
CreateWindow
CreateWindowEx
DeferWindowPos
DestroyWindow
EnableWindow
EndDeferWindowPos
EnumChildProc
EnumChildWindows
EnumThreadWindows
EnumThreadWndProc
EnumWindows
EnumWindowsProc
FindWindow
FindWindowEx
GetClientRect
GetDesktopWindow
GetForegroundWindow
GetLastActivePopup
GetNextWindow
GetParent
GetTopWindow
GetWindow
GetWindowPlacement
GetWindowRect
GetWindowText
GetWindowTextLength
GetWindowThreadProcessId
IsChild
IsIconic
IsWindow
IsWindowUnicode
IsWindowVisible
IsZoomed
MoveWindow
OpenIcon
SetForegroundWindow
SetParent
SetWindowLong
SetWindowPlacement
SetWindowPos
SetWindowText
ShowOwnedPopups
ShowWindow
ShowWindowAsync
TileWindows
WindowFromPoint
WinMain
Obsolete Functions
AnyPopup
EnumTaskWindows
GetSysModalWindow
GetWindowTask
SetSysModalWindow
#4
晕,这些函数都是在vc或其它语言里面调用的
关键是,我想用js传进当前ie的窗口句柄
关键是,我想用js传进当前ie的窗口句柄
#5
就是,js里面有获得句柄的函数么?
#6
我才晕
activex有现成的方法获得加载自己网页的浏览器指针和文档指针,楼主的方法我倒是头一次听说
楼主可以参考这个帖子:
http://www.iscoding.com/showthread.aspx?postid=10691
activex有现成的方法获得加载自己网页的浏览器指针和文档指针,楼主的方法我倒是头一次听说
楼主可以参考这个帖子:
http://www.iscoding.com/showthread.aspx?postid=10691
#7
Activex 里面要获取IE的句柄,可以通过循环用GetParent的方法来获取,我试过,是可以获取到的。不过前提是,你的Activex要在IE中被调用
#8
嗯,如果用CreateObject的方式,就是没有。不过用FindWindow的方式,如果有相同的网页名称,会出现混乱。最后我用IE页面加载控件的方式,通过继承SetSite的函数,完美解决了这个问题。
#9
IServiceProvider *isp, *isp2 = NULL;
IWebBrowser2* pWebBrowser = NULL;
HRESULT hr = m_pClientSite->QueryInterface(IID_IServiceProvider, reinterpret_cast<void **>(&isp));
hr = isp->QueryService(SID_STopLevelBrowser, IID_IServiceProvider, reinterpret_cast<void **>(&isp2));
hr = isp2->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, reinterpret_cast<void **>(&pWebBrowser));
IWebBrowser2* pWebBrowser = NULL;
HRESULT hr = m_pClientSite->QueryInterface(IID_IServiceProvider, reinterpret_cast<void **>(&isp));
hr = isp->QueryService(SID_STopLevelBrowser, IID_IServiceProvider, reinterpret_cast<void **>(&isp2));
hr = isp2->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, reinterpret_cast<void **>(&pWebBrowser));
#10
楼上的正解,不需要传,直接在ActiveX里面得到
#11
各位兄台,请给楼主一点实际,不要空说。谁不会空口白话呢?
#12
HOOK IE啊,然后把HWND当INT型传给ACTIVEX
#13
标记
#14
http://support.microsoft.com/kb/150204/en-us
How to retrieve the actual parent window of an ActiveX control
// The following code should return the
// actual parent window of the ActiveX control.
HWND CMyOleControl::GetActualParent()
{
HWND hwndParent = 0;
// Get the window associated with the in-place site object,
// which is connected to this ActiveX control.
if (m_pInPlaceSite != NULL)
m_pInPlaceSite->GetWindow(&hwndParent);
return hwndParent; // Return the in-place site window handle.
}
How to retrieve the actual parent window of an ActiveX control
// The following code should return the
// actual parent window of the ActiveX control.
HWND CMyOleControl::GetActualParent()
{
HWND hwndParent = 0;
// Get the window associated with the in-place site object,
// which is connected to this ActiveX control.
if (m_pInPlaceSite != NULL)
m_pInPlaceSite->GetWindow(&hwndParent);
return hwndParent; // Return the in-place site window handle.
}
#1
通过接口函数的参数传进去。
#2
嗯,这个晓得,关键是在js里面怎么获取当前窗口的句柄?
#3
Window Functions
The following functions are used to create and manage windows.
AdjustWindowRect
AdjustWindowRectEx
AnimateWindow
ArrangeIconicWindows
BeginDeferWindowPos
BringWindowToTop
CascadeWindows
ChildWindowFromPoint
ChildWindowFromPointEx
CloseWindow
CreateWindow
CreateWindowEx
DeferWindowPos
DestroyWindow
EnableWindow
EndDeferWindowPos
EnumChildProc
EnumChildWindows
EnumThreadWindows
EnumThreadWndProc
EnumWindows
EnumWindowsProc
FindWindow
FindWindowEx
GetClientRect
GetDesktopWindow
GetForegroundWindow
GetLastActivePopup
GetNextWindow
GetParent
GetTopWindow
GetWindow
GetWindowPlacement
GetWindowRect
GetWindowText
GetWindowTextLength
GetWindowThreadProcessId
IsChild
IsIconic
IsWindow
IsWindowUnicode
IsWindowVisible
IsZoomed
MoveWindow
OpenIcon
SetForegroundWindow
SetParent
SetWindowLong
SetWindowPlacement
SetWindowPos
SetWindowText
ShowOwnedPopups
ShowWindow
ShowWindowAsync
TileWindows
WindowFromPoint
WinMain
Obsolete Functions
AnyPopup
EnumTaskWindows
GetSysModalWindow
GetWindowTask
SetSysModalWindow
The following functions are used to create and manage windows.
AdjustWindowRect
AdjustWindowRectEx
AnimateWindow
ArrangeIconicWindows
BeginDeferWindowPos
BringWindowToTop
CascadeWindows
ChildWindowFromPoint
ChildWindowFromPointEx
CloseWindow
CreateWindow
CreateWindowEx
DeferWindowPos
DestroyWindow
EnableWindow
EndDeferWindowPos
EnumChildProc
EnumChildWindows
EnumThreadWindows
EnumThreadWndProc
EnumWindows
EnumWindowsProc
FindWindow
FindWindowEx
GetClientRect
GetDesktopWindow
GetForegroundWindow
GetLastActivePopup
GetNextWindow
GetParent
GetTopWindow
GetWindow
GetWindowPlacement
GetWindowRect
GetWindowText
GetWindowTextLength
GetWindowThreadProcessId
IsChild
IsIconic
IsWindow
IsWindowUnicode
IsWindowVisible
IsZoomed
MoveWindow
OpenIcon
SetForegroundWindow
SetParent
SetWindowLong
SetWindowPlacement
SetWindowPos
SetWindowText
ShowOwnedPopups
ShowWindow
ShowWindowAsync
TileWindows
WindowFromPoint
WinMain
Obsolete Functions
AnyPopup
EnumTaskWindows
GetSysModalWindow
GetWindowTask
SetSysModalWindow
#4
晕,这些函数都是在vc或其它语言里面调用的
关键是,我想用js传进当前ie的窗口句柄
关键是,我想用js传进当前ie的窗口句柄
#5
就是,js里面有获得句柄的函数么?
#6
我才晕
activex有现成的方法获得加载自己网页的浏览器指针和文档指针,楼主的方法我倒是头一次听说
楼主可以参考这个帖子:
http://www.iscoding.com/showthread.aspx?postid=10691
activex有现成的方法获得加载自己网页的浏览器指针和文档指针,楼主的方法我倒是头一次听说
楼主可以参考这个帖子:
http://www.iscoding.com/showthread.aspx?postid=10691
#7
Activex 里面要获取IE的句柄,可以通过循环用GetParent的方法来获取,我试过,是可以获取到的。不过前提是,你的Activex要在IE中被调用
#8
嗯,如果用CreateObject的方式,就是没有。不过用FindWindow的方式,如果有相同的网页名称,会出现混乱。最后我用IE页面加载控件的方式,通过继承SetSite的函数,完美解决了这个问题。
#9
IServiceProvider *isp, *isp2 = NULL;
IWebBrowser2* pWebBrowser = NULL;
HRESULT hr = m_pClientSite->QueryInterface(IID_IServiceProvider, reinterpret_cast<void **>(&isp));
hr = isp->QueryService(SID_STopLevelBrowser, IID_IServiceProvider, reinterpret_cast<void **>(&isp2));
hr = isp2->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, reinterpret_cast<void **>(&pWebBrowser));
IWebBrowser2* pWebBrowser = NULL;
HRESULT hr = m_pClientSite->QueryInterface(IID_IServiceProvider, reinterpret_cast<void **>(&isp));
hr = isp->QueryService(SID_STopLevelBrowser, IID_IServiceProvider, reinterpret_cast<void **>(&isp2));
hr = isp2->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, reinterpret_cast<void **>(&pWebBrowser));
#10
楼上的正解,不需要传,直接在ActiveX里面得到
#11
各位兄台,请给楼主一点实际,不要空说。谁不会空口白话呢?
#12
HOOK IE啊,然后把HWND当INT型传给ACTIVEX
#13
标记
#14
http://support.microsoft.com/kb/150204/en-us
How to retrieve the actual parent window of an ActiveX control
// The following code should return the
// actual parent window of the ActiveX control.
HWND CMyOleControl::GetActualParent()
{
HWND hwndParent = 0;
// Get the window associated with the in-place site object,
// which is connected to this ActiveX control.
if (m_pInPlaceSite != NULL)
m_pInPlaceSite->GetWindow(&hwndParent);
return hwndParent; // Return the in-place site window handle.
}
How to retrieve the actual parent window of an ActiveX control
// The following code should return the
// actual parent window of the ActiveX control.
HWND CMyOleControl::GetActualParent()
{
HWND hwndParent = 0;
// Get the window associated with the in-place site object,
// which is connected to this ActiveX control.
if (m_pInPlaceSite != NULL)
m_pInPlaceSite->GetWindow(&hwndParent);
return hwndParent; // Return the in-place site window handle.
}