读书人

firebreath怎样获取网页窗口句柄解决办

发布时间: 2012-02-04 15:43:09 作者: rapoo

firebreath怎样获取网页窗口句柄
用npAPI库获取网页窗口句柄是
NPWindow* pNPWindow,
HWND hWnd = (HWND)pNPWindow->window;
我用firebreath框架编写一个网页播放器,要调用void Play(LONG port, HWND hwnd),怎样获取网页窗口句柄呢???
急急急~~~~~

[解决办法]
刚好很久前用过firebreath

对onWindowAttached(FB::AttachedEvent *evt, FB::PluginWindow *win)
传入的参数win调用hwnd = wnd->getHWND();即可得到浏览器窗口句柄。
[解决办法]
在继承FB::PluginCore的类中处理AttachedEvent事件
BEGIN_PLUGIN_EVENT_MAP()
EVENTTYPE_CASE(FB::AttachedEvent, onWindowAttached, FB::PluginWindow)
END_PLUGIN_EVENT_MAP()

读书人网 >C++

热点推荐