1

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 perfectly. I send a COM server, built in Delphi, a menu path string, and it sends back a window handle, which I pass to the host control described in the blog. The Delphi window receives nearly all events (rather, Windows Messages) correctly, without any intervention on my part.

The only problem is the buttons. They receive a click event/message fine, and work, but now the Delphi guys have added new icons to the buttons, and each button has an active icon, a hover icon, and a click icon. They receive none of the messages they should to change these icons. Why do nearly all messages work except these? What can I read and or do to try and correct this?

ProfK
  • 44,292
  • 106
  • 358
  • 713

1 Answers1

0

In MouseOver event, send some user message and catch it.

WPF and Win32 Interoperation
HWNDs inside WPF > Notable Differences in Input behavior

While the mouse is over the HwndHost, your application does not receive WPF mouse events, and the value of the WPF property IsMouseOver will be false.

Toris
  • 2,158
  • 10
  • 14
  • The events are Delphi events, handled in Delphi code. This works fine until that window is 'hosted' by my window. Then it becomes a lower down matter than WPF or Delphi code. – ProfK Jul 12 '14 at 11:36