Elmi
Elmi

Reputation: 6193

Use standard Window to draw with wxWidgets into?

Following situation: I have a DLL that bases on wxWidgets and can generate a lot of wxWidgets-GUI-elements. Next there is a calling application which makes use of this DLL and its functions.

This calling instance e.g. can be a C#-application with absolutely no wxWidgets bindings. It comes with an own user interface that includes a wf:Panel.

In a next step the C#-application retrieves the windows HWND of this wf:Panel and hands it over to my DLL. This HWND is a valid, native Windows handle.

My question: what do I have to do within my DLL exactly in order to use this HWND / this wf:Panel as an wxWidgets-element where I can place standard GUI-elements like a wxButton/wxSizers and so on?

I found a function SetHWND() but this does not seem to do the trick as it expects a wxWidgets-generated panel while I have a panel that is generated in my C#-application...

Upvotes: 2

Views: 332

Answers (1)

VZ.
VZ.

Reputation: 22688

You can use wxNativeContainerWindow to create a wxTopLevelWindow representing the foreign HWND you're given and then use it as the parent for all your other windows.

Upvotes: 2

Related Questions