We need to make it a Accessibility app by setting uiAcess=true in the manifest, sign the executable, and placing it in a secure location (e.g. Program Files) as described below:
- Set uiAccess=true in the manifest
Set this option in Visual Studio by setting Linker | Manifest File | UAC Bypass UI Protection to Yes - Sign the executable
See https://video2.skills-academy.com/en-us/previous-versions/bb756995(v=msdn.10) - Place it in a secure location
See https://video2.skills-academy.com/en-us/windows/security/threat-protection/security-policy-settings/user-account-control-only-elevate-uiaccess-applications-that-are-installed-in-secure-locations