VST like juce GUI from a DLL


#1

Hello everybody and sorry for bringing the GUI from DLL topic up again but i’m quite stuck at the moment :slight_smile:

I’m trying to implement something similar to VSTs
My host application is providing a HWND to a DLL plugin
the DLL is using JUCE to create a GUI component wich should rendered to the HWND from the host window.

So far the dll is loading and i have sucessfully Rendered the GUI to the window of the host - the juceVST code was a great help.

My problem is that the GUI in the host window is not getting any mouse events. In the VST code there is code for linux and mac to forward mouse events to the plugin, but i couldn’t find any code for windows. How is this done with the JUCE VSTs?

In the DLL I call

I have added my GUI component to the parent HWND via

[code]mGui = new MainComponent();
mGui->setOpaque(true);
mGui->setVisible (true);
mGui->setSize(400,400);
mGui->addToDesktop(0,parent);

[/code]

I do the repaint via an idle() callback from the host.

There doesn’t seem to be a ‘SharedMessageThread’ function like on Linux and also no MouseHook besides the wheel.
In the juce plugin host the “overload mouse/keyboard events to forward them to the plugin’s inner window…” functions are only available for mac/linux

any hints are very appreciated :slight_smile:

comboy


#2

just had an idea i had this morning…

could it be that the mouse events are not received because the position of the child component in the host window is not set correctly?
since windows is handling mouse events globally and i haven’t implemented all the resize functions so far, th echild from the dll is moved by the host window but hasn’t received a positionChanged or resized call?

comboy


#3

success :slight_smile:

Just got it working.
Sad thing is I don’t know what i did wrong last time.
I just started a fresh demo project and this time it just worked.
I think I can post some demo code soon.

One thing that confuses me is the native window handles from juce.
I have a documentWindow containing a child component.
When I give the handle from the child Component to my DLL it still draws over the whole DocumentWindow (title bar etc).
Do all Juce Components inside a Window have the same native window handle?

I would have expected my plugIn to draw just over the child, not over the parent DocumentWindow.

Comboy


#4

Thank you!
Your feedback is very useful to using JUCE for beginner.
Good luck you~