Can we use both WinUI3 controls and Win32 controls in a WinUI3 application?

Harshithraj1871 1,706 Reputation points
2022-12-05T06:13:30.36+00:00

Hi,

I'm using WinUI3 application, As we can extract HWND from WinUI3 window, and we can attach Window Proc with SetWindowSubclass and manage WM_* messages, I was wondering if we can use Win32 controls and WinUI3 controls at the same time.

I was able to pop a Win32 messagebox on an event, but I was not able to use controls like static and edit text to display data on screen along with WinUI3 controls.

It would be great if you could help me in using both WinUI3 controls and Win32 controls in a WinUI3 application.

Thank you

Windows development | Windows App SDK
Windows development | Windows API - Win32
Developer technologies | C++
{count} votes

Accepted answer
  1. Castorix31 90,686 Reputation points
    2022-12-05T07:55:17.657+00:00

    Yes, you can create Win32 controls in WinUI 3 apps with CreateWindowEx
    I often use them as container in samples I uploaded on GitHub, like in MainWindow.xaml.cs or ContainerPanel.xaml.cs

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.