H.InputSimulator icon indicating copy to clipboard operation
H.InputSimulator copied to clipboard

UIPI Problem

Open gkapellmann opened this issue 2 years ago • 3 comments

Describe the bug

Thank you for your help with this package, to keep it up to date.

I am trying to use this from a Service.

I get this Exception: System.Exception: Some simulated input commands were not sent successfully. The most common reason for this happening are the security features of Windows including User Interface Privacy Isolation (UIPI). Your application can only send commands to applications of the same or lower elevation. Similarly certain commands are restricted to Accessibility/UIAutomation applications. Refer to the project home page and the code samples for more information.

I hve tried using impersonation, but doesnt make a difference, and running a service as admin is not an option due to how services work.

Any ideas? Thank you for your time!

Steps to reproduce the bug

1.- Start a basic Service in .Net Core 2.- Attempt using the input class

Expected behavior

No response

Screenshots

No response

NuGet package version

No response

Platform

Console

IDE

Visual Studio 2022

Additional context

No response

gkapellmann avatar Jul 14 '23 20:07 gkapellmann

Seems like https://github.com/HavenDV/H.InputSimulator/issues/3 But according to my knowledge, there shouldn't be a problem with services here, they usually run with elevated privileges (I could be wrong). Perhaps the problem is that you are debugging an application from Visual Studio running in non-administrator mode, and this causes further problems?

HavenDV avatar Jul 14 '23 22:07 HavenDV

I am not sure about the services permissions either.

But I am deploying the service, so is not being debuged in visual studio. I write to the event manager from windows, so that is how i know what happens. But the service is deployed as normal.

gkapellmann avatar Jul 16 '23 17:07 gkapellmann