Search code examples
firebreath

Image Viewer Plugin - Part 2


in a former thread ( Adding a user interface to an image viewer plugin ) I have got some good insight on how to add GUI controls to a firebreath plugin. Taxilian pointed out that when I use a windowed plugin under Windows it should be straighforward. Basically like developing any other Windows App.

Now, to make sure I understand correctly. I'm suppose to create a child window from the window handle supplied by the onWindowAttached event. To create such a child window I need to register such windows class with ::RegisterClassEx(...) to have my own Window Procedure. Is that correct? I mean how else would get access to WM_COMMAND events?

Once that is done I need to ::CreateWindowEx(...) my child window with the hwnd from the plugin.

Is that the right way of thinking?

Thanks ahead, Christian


Solution

  • Actually creating a child window is optional; WM_COMMAND events for your actual plugin window will be delivered encapsulated in a WindowsEvent that you can catch the same way you get an AttachedEvent. All windows events are sent that way.

    Another option is to do what you describe and register a new class with a WINPROC and create a child window. The main reason for doing that would be that you might be able to more easily interact with an abstraction like wxWidgets, etc because it will not know what FireBreath is to get events from it that way. Either method should work fine.