Click here to Skip to main content
15,120,268 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a winform project. and I want it to fire keydown events even when the form is minimized, is there a way to do this?


What I have tried:

i tried sendkeys, already exists my project, but not work on background
Posted
Updated 17-Aug-21 0:37am

No - keydown events only go to the current active application, and a minimized app is not active.

To do that, you'd have to install a global hook and that is horribly complicated in C#, as well as both dangerous (you can easily crash your whole system) and liable to be viewed as "possible virus activity" in that it starts to look like a keylogger.

Why do you think you need this?
   
well, I solved my problem, but I have a question with findwindow: I said findwindow a find VALORANT window, but even anywhere it triggers events under findwindow, I want it to run only in VALORANT window
   
Comments
Ralf Meier 17-Aug-21 5:41am
   
If you have an additional question then start another question and don't post it as a Solution ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900