Question: How to migrate a simple Win32 app to WinUI 3.0
See original GitHub issueI’m currently attempting to figure out how to port my Win32 application to WinUI 3.0. To better understand how basic things are done I’m trying to turn this Microsoft Win32 sample app into a C++/WinRT based WinUI 3.0 app.
To do so I have installed the Visual Studio WinUI 3.0 Project Templates and have created a new project from the “Blank App, Packaged (WinUI in Desktop)” template. However, there are many things that are unclear to me and I hope some kind soul might help me along with some hints. I stumbled over the following very basic issues:
- The
wWinMain
function in the mentioned sample sets up the message loop. Where do I need to set the message loop up in WinUI 3.0? - Where would I attach the
WndProc
callback function that processes the messages? - The sample draws on the window by obtaining an
HDC
using theGetDC
function. How does this translate to WinUI 3.0? Am I able to draw into a window by simply obtaining the window’sHDC
as well?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:12 (3 by maintainers)
Top Results From Across the Web
User interface migration (including WinUI 3) - Windows apps
This topic shows how to migrate your user interface (UI) code, including migrating to the Windows UI Library (WinUI) 3.
Read more >How to Upgrade a UWP Application to WinUI 3.0
In this post we'll look at a migration approach that will allow you to keep your UWP app running in parallel to a...
Read more >Building Modern Desktop Apps with .NET and C - WinUI 3.0
NET Windows Developers to build a desktop application with C#. You can choose Windows ... WinUI 3.0 is an evolution of the UWP...
Read more >Building Modern Desktop Apps—Is WinUI 3.0 the Way to Go?
WinUI 3.0 is the hot new framework for desktop application development. In this post we'll try to answer the questions “What is WinUI...
Read more >Migrating Uno (UWP) application to WinUI 3.0
1 Answer 1 ... WCT (Windows Community Toolkit) packages are published under a different name for WinUI: they are named CommunityToolkit.WinUI.* ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seconded. I also have an old Win32 project that I would like to boost using WinUI, and the sample linked by the OP covers most of the use cases involved. The documentation keeps pointing to XAML Islands, but there is no comprehensive guide that describes, from start to finish, how to take a legacy project (i.e without any configuration for WinUI) and setting it up to use WinUI.
Most of our team is on holiday break now, but I’m hoping when we return in Jan someone from the engineering side will be able to answer your specific questions, @ackh. Sorry about the delay here.
@janos-ijgyarto - as for documentation for migrating apps to WinUI 3, I know that this is a gap in our documentation. This is something we’re hoping and aiming to provide at the WinUI 3.0 release, so stay tuned.