0

I created a 64 bits Plugin (VST JUCE) and it creates a new process that is a 32 bits application. In this application I host a 32 bits Plugin (VST JUCE).

Now I wonder if it's possible to make the editor of the 32 bits process attach its editor to the main 64 bits plugin window handle. I could pass the original window handle using my piped process. And call:

VSTPluginFormat::dispatcher(pluginLoad, 14, 0, 0, windowHandle, 0);

The code 14 opens the editor.

So the question is, does Windows allow this? Or are windows handle private to each program/process?

If I could do this, I just need to figure out how to convert a windows handle void* into an int64 and send to my process. There I need to convert back from int64 to void*.

Thank you.

1 Answers1

0

Windows handles are global (and also always in the lower 4GB so you can transfer them between x86/x64 apps) and you can do it but when hosting VST plugins it's not advised to do so. You would have some hard time to marshal pointers between your applications and the VST SDK isn't designed with that in mind.

The solution I follow is to use plain interop (usually COM but you can also use File Mapping) to transfer data between the editor and the host.

Michael Chourdakis
  • 10,345
  • 3
  • 42
  • 78
  • SetParent works perfectly and it is compatible by Windows, as windows handles are 32 bits in size, so all is good. :-) – William Wusik Kalfelz Apr 10 '19 at 21:11
  • With windows it is compatible, VST windows are not aware of this. – Michael Chourdakis Apr 10 '19 at 21:12
  • Indeed. I'm getting some weird behaviour with SetParent, so I had to ditch the idea. Looks like the best option would be to screenshot the original window at X ms and send mouse event commands to it. Just need to figure out the later. – William Wusik Kalfelz Apr 11 '19 at 20:33
  • In my library I use RDP to transfer data between machines. – Michael Chourdakis Apr 11 '19 at 20:36
  • No, the data transfer is already working great. What I don't know is how to create and send mouse events to another window. – William Wusik Kalfelz Apr 11 '19 at 20:46
  • VST3 supports sending through its interfaces. – Michael Chourdakis Apr 11 '19 at 21:05
  • Yeah, but I'm mostly using VST2 for this. In the end here's what I did: I use the BringWindowToTop Windows command when the mouse clicks the parent interface or move/enters the parent area. And I screenshot the bridged UI with createSnapshotOfNativeWindow (JUCE function) ever 100ms. It works very good, actually. I just get the HWND from the bridged windows and everything else is easy to do. Thanks for the tips so far. – William Wusik Kalfelz Apr 13 '19 at 19:41