Questions tagged [wpf-interop]

12 questions
8
votes
1 answer

Why is my WPF hosted WinForm blank?

I have used the code from this blog, as below but abridged, and I see the WinForm inside my main window, but the sample text I placed on it in a label is not visible. [System.Windows.Markup.ContentProperty("Child")] public class WinFormsHost :…
ProfK
  • 44,292
  • 106
  • 358
  • 713
4
votes
2 answers

Is it possible to host a QT application into a WPF application?

I'm trying to create WPF GUI application to host an already exist QT GUI application as part of the main UI. The QT application don't need to deal with mouse/keyboard input. I've tried approach mentioned in this SO Post. Seems all those approach…
ricky
  • 1,768
  • 3
  • 15
  • 40
2
votes
1 answer

WPF Interop Control renders black when .Net Framework is changed from 3.5 to 4.5

I have an interop question about embedding WinForms controls into a WPF application and differences in the .Net framework versions. The following should show a transparent wpf control (red box) over a WebBrowser control and works as expected when…
Beachwalker
  • 6,930
  • 5
  • 47
  • 86
1
vote
0 answers

How to set a thread's DPI_AWARENESS_CONTEXT in a WPF application?

I'm trying to figure out how I can temporarily disable DPI awareness in a WPF-application to set Window Placement. Following this example I'm essentially trying to run the following from my Window's code behind: DPI_AWARENESS_CONTEXT…
ymbcKxSw
  • 165
  • 3
  • 9
1
vote
0 answers

Wpf Monogame Interop wont load in Designer

Hi im using the WpfInterop NuGet Plugin from this Location https://gitlab.com/MarcStan/MonoGame.Framework.WpfInterop/ I did everything the way it is in the readme file but itjust wont load in my designer. It always says "An Instance of "Game1" could…
1
vote
2 answers

ElementHost flickers black borders on resize

Disclaimer: This is not a duplicated post. I googled about the issue. Also read this, this and this SO questions. I tried some of those things but nothing seemed to help. Consider the following simple example code. It's just an empty ElementHost…
Daniel Peñalba
  • 27,557
  • 31
  • 124
  • 209
1
vote
1 answer

Hosted window in WPF doesn't get mouse messages

Taking it a bit further than hosting WinForms user controls in my WPF application, I am actually hosting Delphi forms, i.e. top level windows. I am doing so through the voodoo in blog post How To Host Top-Level HWNDs In WPF. Nearly everything works…
ProfK
  • 44,292
  • 106
  • 358
  • 713
1
vote
0 answers

What windows messages must I handle when I host a Win32 window inside a WPF control?

So far, I only know I must listen for WM_CLOSE, which is a request to close, and WM_DESTROY, which is when the window is actually destroyed after closing. I need to handle these because I need to avoid a useless Win32 host view with a closed Win32…
ProfK
  • 44,292
  • 106
  • 358
  • 713
0
votes
1 answer

Win32 native control in layered (transparent) WPF window is invisible

I want to host a native Win32 (Qt widget) control in a WPF window. My problem is that in case I host it in a normal WPF window, everything works fine, but when I set AllowsTransparency of the WPF window to true, the native content won't be rendered…
0
votes
1 answer

How do I get a WPF Window "from" an HwndSource I create directly?

If I create an HwndSource directly, have I then also created a WPF Window that I can now access from code? If so, how can I access it? Or do I now need to somehow "add" a WPF Window to that HwndSource? If so, how do I do this? I have studied the…
Cardinal Fang
  • 253
  • 2
  • 9
0
votes
0 answers

WPF Winforms Interop eating keystroke

I create a winform project with a single form with 4 textboxes and a button. On button click, I perform the following: Window1 w = new Window1(); ElementHost.EnableModelessKeyboardInterop(w); w.Show(); Where window 1 is a Wpf window. Window1 has a…
CodeHulk
  • 111
  • 1
  • 12
0
votes
2 answers

How can I communicate with a Delphi window hosted in a WPF User Control?

Well, actually I know I can communicate with the window itself, the plane GUI, through it's message pump, but let's say I want to call a COM exposed function in the Delphi DLL that produced and maintains that window? I would first somehow have to…
ProfK
  • 44,292
  • 106
  • 358
  • 713