Search code examples
c++audiowindowsdlvst

How can I create a child window in VST 2.4?


I create ExampleEditor.h and ExampleEditor.cpp

ExampleEditor::ExampleEditor(AudioEffect *effect)
{           
    effect->setEditor(this);
};

bool ExampleEditor::open(void *ptr)
{

    //This is it?

return true;
};

VST plugin file constructor i write

VstPlugin::VstPlugin(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, 1, 1)
{
    editor = new ExampleEditor(this);
}

In what point do I need to create a window? The main window has already been created in the VST? Can I use any library or to create a window? SDL2 ? Can anyone give a very simple example?


Solution

  • Assuming Windows: In open(), cast the void* ptr to a HWND. That is the window handle to the (host-provided) parent frame window. When using any library use this handle as a parent handle when creating the child plugin window. The child window you create must have the WS_CHILD flag set.