Windows Store App - remove fullTrustCapability - c++

I'm developing a C++-Win32-app which should be deployed in the Microsoft Store. Unfortunately, since runFullTrustis added automatically as required capability, the program appears in Microsoft Store as follows: "This app can access all your files, peripheral devices, apps, programs and registry.", but I don't need all of those capabilities. Is there any possibility to get rid of the runFullTrust capability or to choose which capabilities are really needed?

If you want to publish the Win32 apps in Microsoft Store, and you must add restricted capability runFullTrust in the manifest.
Only UWP app can be published in the Microsoft Store,if you have an existing desktop application that was built using the .NET Framework (including WPF and Windows Forms) or C++ Win32 APIs, you can several options(Package your desktop application in an MSIX package, Use UWP APIs...) for moving to the UWP and Windows 10. The moved app called desktop bridge apps. You can see more details in document:
Move from a desktop application to UWP
The restricted capability runFullTrust is required for any desktop application that is delivered as an appx or msix package (as with the Desktop Bridge), and it will automatically appear in your manifest when packaging these apps using the Desktop App Converter (DAC) or Visual Studio. You can see this in document:
Restricted capabilities

Related

CNG/BCrypt APIs in Windows IoT?

Does Windows IOT supports CNG/BCrypt APIs?
If possible, I'd like to have some references in case it does support.
It is supported. You can see that API support desktop apps and UWP apps.
But there seems no such UWP sample. You can reference "Encrypting Data with CNG" and "Typical CNG Programming" for desktop and create your own C++ UWP application.
Reference "Developing UWP applications for Windows IoT Core - C++"
Windows IoT Core also supports certain traditional Win32 app types such as Win32 Console Apps. There is an IoT Core C++ Console project template to make it easy to build such apps using Visual Studio.

Project Type for simple headless windows application

I am creating a Windows app that will run on Windows 2012r2 and soon be migrated to newer servers.
This app will be started from task scheduler and run several times a day.
It will start up, monitor a file system and, based on what it finds on the file system, will update a database.
I want it to run even when the user is not logged in.
I don't want it to pop up a console window while it is running because I inherited some applications that are doing that and it is quite annoying.
I will be writing it in C#.
In Visual Studio 2017 which project type should I choose?
Blank App
WPF App
Console App (.NET Core)
Console App (.NET Framework)
Other?
I am new to Windows development so please use terminology that I will see in Visual Studio 2017 so I can understand the answer.
[EDIT] I changed Console App (.Net Standard) to (.Net Framework) because Standard does not exist. I was suffering from temporary insanity when I listed that as an option.
Since there is no user interface, and you are just monitoring the file system and updating a database and running on a Window Server I would recommend:
4. Console App (.NET Framework), and in the Application/Properties for the app set the output type to Windows application and this will prevent any type of console window from showing. This is the type of application I use on a frequent basis to accomplish tasks very similar to what you are describing. The security settings you have for the user account logging into the server will determine if you can run it whether the user is logged in or not.

How can I call an UWP API from a C++ desktop application

I would like to access Bluetooth LE devices using the corresponding UWP APIs. However, my application is a "classic" C++ application (3D game) that can't run as a UWP app. Is there a way to do that? Accorind to enter link description here these APIs are published, but I don't know the steps to access them I have only found some posts for Windows 8/8.1 apps that include the Windows.winmd and Platform.winmd metadata files and set the /ZW compilation flag, but this doesn't seem to apply to Windows 10.
You should be able to do this, as the Bluetooth classes (e.g., BluetoothLEAdvertisement) are marked up with DualApiPartitionAttribute (callable from desktop and UWP apps).
Using one of the older Win8.1 desktop samples should give you a good starting point for calling the APIs without requiring /ZW or referencing the winmd files. A good example is the desktop toast API sample.
If you go that route, you can use classic COM to create the UWP/WinRT classes via WRL helpers.
You can use the web that you make a web server and the C++ application use the same server and if UWP send the info to server then it will send the info to C++ application.
To safe,the UWP can't use the desktop app.

C++ how load the .NET runtime and thereby host WPF components

The Visual Studio devenv.exe executable is a native program. However, native programs can load the .NET runtime and thereby host Windows Forms and WPF components.
I want to do as Visual Studio How to do it?
This blog post from Microsoft and its associated tutorial demonstrate how to use the new CLR hosting API's to host the CLR within your native apps.
This article also illustrates how to use the new CLR4 hosting API's.
As OP requested: Here's the first article of a series exploring how to host the CLR & WPF in a native app.
Also, here's an article about how to host a WPF control within an VC++/MFC app.

Will WinRT be usable in Desktop Apps (no Metro style)? [duplicate]

Can non-Metro Windows apps (ex: Explorer) be built with the new WinRT, or must they still be Win32 based?
I asked this during the 'Ask the Experts' session at //Build/. The answer was "Yes, within reason. Not all of the WinRT api's will function when called from desktop apps - for example any metro specific ones will fail. No explicit list of which ones work from desktop (non-metro) apps is available."
Edit:
It appears that the documentation has been updated to provide a list of WinRT api's available from the desktop.
From "Dev Center - Metro style apps"
A sticky posted by moderator on Thursday, November 03, 2011 1:16 AM
We have received a number of inquiries in this area.
The documentation will be expanding as the Windows 8 project
progresses to include more API specific details. It is possible to
use WinRT from Desktop applications. WinRT APIs may be tied to Metro
style apps, Desktop apps or potentially available to both. The
documentation will list which environments (Desktop, Metro style or
both) a given API works in. Note: Custom WinRT components are only
supported in Metro style applications. They are not supported in
Desktop applications.