Display a Web Page in a Plain C Win32 Application 是一篇好文章
Transparent Flash Control in Plain C++ 也是一篇好文章
为了把WebBrowser画在窗体上
两个工程对比了下
对比
Flash
的接口
?
IOleClientSite
IOleInPlaceSiteWindowless
IOleInPlaceFrame
IStorage
IOleClientSite
IOleInPlaceFrame
IDocHostUIHandler
// IOleInPlaceSite
// IOleClientSite
---------------------------------------
So?
IOleInPlaceFrame
IOleClientSite
IDocHostUIHandler
IOleInPlaceSiteWindowless
IOleClientSite
尝试方案
Flash WindowLess
用法
// IOleInPlaceSiteWindowless interface
virtual HRESULT STDMETHODCALLTYPE CanWindowlessActivate(void);
return S_OK;
virtual HRESULT STDMETHODCALLTYPE GetCapture(void);
return S_FALSE;
virtual HRESULT STDMETHODCALLTYPE SetCapture(/* [in] */ BOOL fCapture);
return S_FALSE;
virtual HRESULT STDMETHODCALLTYPE GetFocus(void);
return S_OK;
virtual HRESULT STDMETHODCALLTYPE SetFocus(/* [in] */ BOOL fFocus);
return S_OK;
virtual HRESULT STDMETHODCALLTYPE GetDC(/* [in] */ LPCRECT pRect,
/* [in] */ DWORD grfFlags,
/* [out] */ HDC __RPC_FAR *phDC);
return S_FALSE;
virtual HRESULT STDMETHODCALLTYPE ReleaseDC(/* [in] */ HDC hDC);
return S_FALSE;
virtual HRESULT STDMETHODCALLTYPE InvalidateRect(/* [in] */ LPCRECT pRect,
/* [in] */ BOOL fErase);
virtual HRESULT STDMETHODCALLTYPE InvalidateRgn(/* [in] */ HRGN hRGN,
/* [in] */ BOOL fErase);
return S_OK;
virtual HRESULT STDMETHODCALLTYPE ScrollRect(/* [in] */ INT dx,
/* [in] */ INT dy,
/* [in] */ LPCRECT pRectScroll,
/* [in] */ LPCRECT pRectClip);
NOTIMPLEMENTED
virtual HRESULT STDMETHODCALLTYPE AdjustRect(/* [out][in] */ LPRECT prc);
return S_FALSE;
virtual HRESULT STDMETHODCALLTYPE OnDefWindowMessage(/* [in] */ UINT msg,
/* [in] */ WPARAM wParam,
/* [in] */ LPARAM lParam,
/* [out] */ LRESULT __RPC_FAR *plResult);
return S_FALSE;
如何获取
IID_IViewObjectEx?
只能获取
IID_IViewObject
Q5:
研究
Flash
这两个
Object
如何获得?
IViewObjectEx
*
m_lpViewObject
;
IViewObjectEx
*
m_lpViewObjectEx
;
在
Flash
的代码中有以下的特殊处理
hr
=
m_lpO
->
QueryInterface
(
IID_IViewObjectEx
, (
void
**)&
m_lpViewObjectEx
);
if
(
FAILED
(
hr
) )
{
m_lpViewObjectEx
=
NULL
;
hr
=
m_lpO
->
QueryInterface
(
IID_IViewObject
, (
void
**)&
m_lpViewObject
);
if
(
FAILED
(
hr
))
return
FALSE
;
}
实验后,发现
IOleInPlaceSiteWindowless::InvalidateRect()
根本没有响应到
在
Flash
的基础上修改