Questions tagged [hwndhost]
34 questions
44
votes
6 answers
Hosting external app in WPF window
We are developing a layout manager in WPF that has viewports which can be moved/resized/etc by a user. Viewports are normally filled with data (pictures/movies/etc) via providers that are under our control in the layout manager. My job is to examine…

Stiggy
- 459
- 1
- 5
- 4
21
votes
6 answers
'{DependencyProperty.UnsetValue}' is not a valid value for property 'FocusVisualStyle'
I have a weird error I'm trying to debug with no luck.
I have subclassed hwndhost showing some content, I have the following function in that class to set to fullscreen:
private void SetFullScreen(bool enable)
{
if (enable)
…

DaveO
- 1,909
- 4
- 33
- 63
12
votes
3 answers
How can I convert Win32 mouse messages to WPF mouse events?
I have a Win32 (OpenGL) control that I need to embed in our WPF application. It must respond to, and propogate, mouse and keyboard events.
I've created a HwndHost derived instance to host the native window and have overridden the WndProc function in…

Josh
- 450
- 3
- 12
9
votes
2 answers
Custom dwm drawn window frame flickers on resizing if the window contains a HwndHost element
I've been thinking about this for a couple of days but I think I lack some basic understanding of how windows and wpf work internally to figure this out.
The problem is this:
I created a window that should let me draw wpf controls on an aero title…

Roald
- 1,722
- 11
- 21
8
votes
1 answer
Passing Input events from HwndHost to underlying WPF controls?
is there a way to pass input events (primarily mouse, but eventually keyboard input too) that occurs on a HwndHost back to the underlying WPF controls (e.g. a panel) ? i can hook up to WndProc within the HwndHost and recveive the windows messages.…

Joachim Kerschbaumer
- 9,695
- 7
- 49
- 84
6
votes
3 answers
Proper way of hosting an external window inside WPF using HwndHost
I'd like to host a window of an external process inside my WPF application. I'm deriving HwndHost like this:
class HwndHostEx : HwndHost
{
[DllImport("user32.dll")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr…

Mike G
- 185
- 5
- 17
5
votes
4 answers
Forcing initialization of a HwndHost
In my WPF application, I host Win32 content using HwndHost. However, creating a HwndHost does not create the native window. Rather, this is done in the overridden BuildWindowCore() method which is called sometime later by WPF.
My hosted content…

Daniel Rose
- 17,233
- 9
- 65
- 88
5
votes
0 answers
wpf HwndHost MouseMove event before previous element MouseLeave event
We have a Wpf application with an Hwndhost element we use for rendering 3d content via DirectX. We expose a "Panel" interface to clients which contains a MouseEnter and MouseLeave event. For the Hwndhost "panel" we simulate a MouseEnter event when…

Hank
- 193
- 1
- 10
4
votes
1 answer
WPF interop - HwndHost not automatically destroying the hosted window
I am having trouble ensuring a hosted window is correctly destroyed.
I have a HwndHost-derived class that I am displaying in a TabControl (though that is probably irrelevant). I am trying to destroy the hosted content when the tab closes (not when…

Cechner
- 849
- 7
- 19
4
votes
0 answers
Hosting multiple HwndHost in a WPF application
I am using an hwndhost element to draw DirectX content in a WPF application. When I override the WndProc for HwndHost I do get called with window messages but only by the first instance of hwndhost that I create.
Basically on the WM_PAINT message I…

user2043696
- 41
- 1
4
votes
1 answer
Host External Application in WPF TabControl
I have managed to create an example project that uses HwndHost to host Notepad (not what my real project will be embedding) inside a C# WPF tab control. For this, many thanks goes to those who replied to Hosting external app in WPF window (BTW…

Youngy
- 516
- 4
- 8
2
votes
1 answer
WPF shortcuts are activating when typing in HwndHost parented rich edit control
I am writing a WPF app that wraps up a legacy MFC richtext editor. I have wrapped the richtext editor in a HwndHost. The HwndHost control sits alongside a WPF TabControl.
Screenshot of running app at http://www.kempy.co.uk/code/Test.png
Apart…

Tim
- 91
- 1
- 7
2
votes
2 answers
What renders WinForm controls that are hosted in a WPF application?
From MSDN article I found out that WinForm controls can be hosted in a WPF application using HwndHost.
Also, from other internet resources, I found that WPF is rendered using DirectX and WinForm is rendered using GDI+.
My question is, what renders a…

Alok
- 46
- 4
1
vote
1 answer
Background Color Artifact in Window's Composition Engine (DWM)
Context from Kenny Kerr's blog:
Windows Vista introduced a service called the Desktop Window Manager. The name was and continues to be misleading. Think of it as the Windows composition engine or compositor. This composition engine completely…

Tom Huntington
- 2,260
- 10
- 20
1
vote
1 answer
Pass string to dll
How to call a function in c++ dll from C# WPF application with string parametrs? I add dll to C# app through "Add References", not "[DLLImport]"
All problem is that C# suggests function with 'sbyte*' parametr, not 'char*'. Functions with 'int'…

EthanHunt
- 473
- 2
- 9
- 19