How to allow uiAccess in UWP application - c++

I am invoking C++ UIautomation modules in my UWP application. The application is not able to extract control elements since it is not running in an elevated environment. How should I set up the manifest file or set my UWP app to be able to get access to ui elements of other applications.

I'd suggest that you could put the UIautomation modules into a console app and then launch the console as elevated from your UWP app using desktop bridge. You will also need to add the allowElevation capability into the manifest file.
For detailed steps, you could take a look at Stefan wick's blog- App Elevation Samples.

Related

Windows Store App - remove fullTrustCapability

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

Windows 10 IoT embedded, trying to get a console app debugging/deployed using Visual Stuido 2019

I've been trying to get a 'console application' to deploy and debug on my embedded Win10 device but I just can't seem to figure it out.
I can get an application to deploy, which requires a 'SquareLogo' screen to come up and I can't figure how to have this 'window' hide or be a headless app.
I can set in the property pages of my app "Property Pages - Configuration Properties - Linker - System - SubSystem" to 'Console (SUBSYSTEM:CONSOLE) and the console window will display on the embedded device but the app screen comes up and the console window will not take any input, from the keyboard.
So in summation I want to debug (Remote Machine) to my embedded Win10 device with a console application.
I'm writing my app in C++.
I won't think it would be this hard but I just can't get the applications main window to not display at startup.
Any help would be appreciated.
Thanks
For Windows IoT Core, you can debug console app using Remote Console App Debugging in Visual Studio. You need to start visual studio debugger on Windows IoT Core in Device Portal.
Please refer to this document.
Debug your app using Remote Console App Debugging
BTW, IoT Core is a UWP centric OS and UWP apps are its primary app type.Since that , traditional UI app can not work on Windows IoT Core, it means Windows IoT Core does not support MFC or ATL APIs.If you want to run a headless app on Windows IoT Core, we recommend you to use Background Applications.

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.

Control Firefox application from another c++ program using xpcom

So far, all xpcom examples I saw are Firefox addons. You write some C++ code, build, and register it. This resembles Microsoft COM in-process server, but instead of Windows registry the component information is stored in Firefox profile.
Does Firefox have out-of-the box ability to control it from another process using same API? Somthing like COM's local server application
When you start a second firefox instance, it communicates with the existing firefox process and tells it to open a new window, then dies. I suspect it uses some remote form of xpcom.