简体   繁体   中英

SendInput function from user32.dll doesn't work if Task Manager is opened

I have programmed in C# an application (in OS Win 10) with a virtual keyboard and mouse. Everything works fine but SendInput or mouse_event function from user32.dll doesn't work if Task Manager is opened. Could someone advise me on how to solve it? I have found that sometimes works if Task Manager is run as admin or Task Manager has Always on top in settings. But this advice doesn't work.

I ran into an issue quite recently using this method. It is down to the permissions your application has when it is running and will only happen when Task Manager is the focussed window. If you run your application as Administrator you should have the permissions required to interact with Task Manager.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM