如何从Win32控制台应用程序使用UWP API [英] How to use UWP API from Win32 Console Application
问题描述
我需要在现有的桌面应用程序中使用UWP LockScreen API。为了简化我的情况,我试图创建一个试图使用UWP API的控制台应用程序。我试着按照这里的指南:https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/,
但我根本无法" ;添加参考" (项目中没有"浏览"选项)。
I need to use the UWP LockScreen API in my existing desktop application. To simplified my situation, I am trying to just create a console app trying to use UWP API. I tried to follow the guide here: https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/, but simply I cannot "Add Reference" (No "Browse" option for the project).
如本文所述,https://msdn.microsoft.com/en-us/library/windows/desktop/ mt695951(v = vs.85).aspx,可以在经典桌面应用程序中使用UWP API。你能给我一些提示吗?
As mentioned in this article https://msdn.microsoft.com/en-us/library/windows/desktop/mt695951(v=vs.85).aspx, it is possible to use UWP API in classic desktop app. Could you give me some hints?
Rdgs,
Marvin
Marvin
推荐答案
您好,
如果您的应用是.NET控制台应用,那么您只需安装 UwpDesktop NuGet包在Dock中。
If your app is .NET Console App then you just need to install UwpDesktop NuGet package as described in dock .
如果你的应用是Win32 C ++ Console App,那么最好的方法就是使用
C ++ Winrt 。
If your app is Win32 C++ Console App then maybe the best way is using C++ Winrt .
这篇关于如何从Win32控制台应用程序使用UWP API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!