Can I use WindowProc in JUCE?

Hello,
I think I can get the HWND handle of this JUCE app (on MS Windows 11)

Then, can I construct my own WindowProc for this HWND
on MS Windows 11 ?

Thank you

You could try subclassing the window, but you’d probably be better off with an HWNDComponent.

What’s the actual problem you’re trying to solve?

Matt

Hello, Matt
How are you?

I have two apps (on Windows 11)
One is Vulkan app
The other is JUCE app, having buttons, lists, sliders, edits
And both communicate using PostMessage and WindowsProc,
usually camera moving information etc

So I want my MainComponent class (JUCE) to have its own WindowProc

MainComponent is as defined

class MainComponent : public juce::AudioAppComponent

Can I do this ?

Thank you

If what you to do is get messages posted from your existing application into your JUCE application, I think the simplest way is to use the Windows API to create a message-only (ie. hidden) window to receive the messages. Then you can forward them to the relevant part of your JUCE code.

You can look at choc for some example code: choc/gui/choc_MessageLoop.h at main · Tracktion/choc · GitHub

Hope this helps!

1 Like

Hello, Jonas

The source you recommend does by creating a new window (CreateWindowA)

I think this can help my issue
I will study the source you suggest

Thank you and have a nice day, Jonas

1 Like