Can We access Win-32 APIs from WinUI-3 based UWP apps?

Rahul K 51 Reputation points
2020-04-23T06:45:14.553+00:00
  • Difference between WinUI-2 and WinUI-3 says that WinUI-3 will work for win-32 also. Does that mean WinUi-3 can be used as UI for Win-32 apps or does that mean using WinUI-3 based UWP apps will we be able access win-32 apps(as normal UWP apps cannot access Win-32 APIs, my doubt is by using WinUI-3 based UWP apps will we get any add-on like access to Win-32 APIs also?)
  • Is the way of operation of WinUI-3 based UWP apps is completely different from normal UWP apps(Will there be different way of working like differences between UWP and WPF) ----(or)---
  • WinUI3 is just a UI loosely coupled from UWP(thinking normal UWP apps have UI tightly coupled with UWP)?
  • References: Differences of WinUI3 to Other Apps ,
    winui3 MS docs
Universal Windows Platform (UWP)
{count} vote

Accepted answer
  1. Alienator 76 Reputation points
    2020-04-24T15:32:03.713+00:00

    Not exactly. If you create an app that's specifically a "Universal" app, then no, you will not have access to win32 APIs, with or without WinUI 3.0.

    However, you can create WPF or WinForms apps that make use of "Xaml Islands". Xaml Islands allow you to host UWP controls. Therefore, you will be able to host WinUI 3.0 controls in your WPF/WinForms app while also making use of win32 APIs.

    There is also a rumored "Xaml Desktop" format that will come out alongside WinUI 3.0. This is expected to allow you to create Visual Studio projects with WinUI as the main UI framework while supporting win32 without having to use Xaml Islands. There's not much detail on how this will work yet, but we know that this will not be considered a true universal app (meaning you can only create these apps for desktop).

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. John Torjo 861 Reputation points
    2020-04-23T07:40:06.737+00:00

    I suggest you post this here: https://github.com/microsoft/microsoft-ui-xaml

    Also, read through the discussions there - there's a lot of info that will explain quite a bit.