I'm developing a windowless plugin using Firebreath and I want to catch a particular message for further processing, I'm able to do it so but the rest of the messages are "lost" I think.
I have this code to hook the messages loop:
bool myPlugin::onWindowAttached(FB::AttachedEvent *evt, FB::PluginWindow* pluginwin)
{
FB::PluginWindowlessWin* win = dynamic_cast<FB::PluginWindowlessWin*>(pluginwin);
FBLOG_INFO("", win->getHWND()); //getHWND returns the HWND of the Internet Explorer_Server window (get by using Spy++)
SubclassWindow(win->getHWND(), (WNDPROC)&myPlugin::WndProc);
return true;
}
And this is the processing function:
LRESULT CALLBACK myPlugin::WndProc(HWND hWindow, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case (WM_ERASEBKGND):
return 1;
}
return DefWindowProc(hWindow, msg, wParam, lParam);
}
This works as expected on IE9 (I'm doing this because I have some problems while repainting an image), but the click message is not processed nor any of the other messages; so if a button is present in the same page as my plugin, it won't be clickable.
I'm running IE9 as a single process.
Any help is appreciated.
Thanks!
You're not calling the previous HWND's wndproc. Universally calling DefWindowProc() is not correct. When you subclass an HWND, you need to get the address of the old wndproc and pass messages you don't handle to it, not DefWindowProc().
I'm not sure how to do that firebreath / ATL.