Native Win32 window in WPF Control

后端 未结 1 1400
时光取名叫无心
时光取名叫无心 2021-02-14 07:55

I am developing an application that needs to a host native Win32 window and somehow i have no clues how to do that.

I need to create a WPF dialog window that could displ

1条回答
  •  一整个雨季
    2021-02-14 08:49

    you can start by following the instructions/steps here: Hosting Win32 Content in WPF

    from the article introduction:

    A Walkthrough of Win32 Inside Windows Presentation Framework (HwndHost)

    To reuse Win32 content inside WPF applications, use HwndHost, which is a control that makes HWNDs look like WPF content. Like HwndSource, HwndHost is straightforward to use: derive from HwndHost and implement BuildWindowCore and DestroyWindowCore methods, then instantiate your HwndHost derived class and place it inside your WPF application.

    If your Win32 logic is already packaged as a control, then your BuildWindowCore implementation is little more than a call to CreateWindow.

    then if you have a specific issue ask here in SO and people will help you on specific points.

    0 讨论(0)
提交回复
热议问题