VST plugin draws its Editor graphics on window title area


I’m making a VST host app and recently I decided to use Juce for making all the application’s UI.
Now, I’m rewriting code related to display plugin editors. Previously I used to create win32 window by CreateWindowEx(), then set the size through SetWindowPos() and just pass its HWND to a plugin instance through dispatch().
This approach worked fine.
However, when I create a window which is an instance of the class inherited from juce::DocumentWindow and then I pass its handle to a plugin, the plugin Editor graphics are drawn covering the window’s title bar area.

Is there any window property which I should set up correctly to avoid this problem?


Why not just use the juce plugin hosting classes to do all that messy UI stuff?

Actually, entire VST host engine is written already. So, I’m just trying to rewrite UI part.
As I wrote, I used to display editors by simply creating a win32 window and passing its handle to a plugin.

When it came to using of juce windows system, I got a trouble with title area.
But its not a problem any more, because I decided that the window which would host a VST editor should also have various UI elements (buttons, combo boxes etc.). So I got into another problem.
Since VST requires window handle, I thought that I can create a main window, then fill its content component with all necessary UI elements and finally create one child window (for VST editor). The child window can be bounded on its place within the main window and its handle can be provided to a plugin.
Unfortunately, when I try to make a second window to be a child of the first one (addChildComponent()), the child loses heavyweight style hence becomes useless for VST.


How to create main and child windows so that both of them would be heavyweight? Is it possible at all?

P.S. “am i right assuming that heavyweight means a component has a native window/peer behind it?”

It’s not something that the library’s designed for, so you’d have to get your hands dirty and do some platform-specific hacking. Take a look at some of the existing classes that embed heavyweight windows and which use juce comps inside host windows for tips.