Y_Y
Y_Y

Reputation: 1285

Is there a way to receive key input to an out-focus form?

I was wondering if it is possible to receive key input to a form that is out of focus. For example, I have my C# form to be top-most of all windows; I want to get all the keys I type on other applications like for example browser to kinda get a history of all the keys I typed while my computer was on.?

Is there a way to do this?

Upvotes: 2

Views: 1529

Answers (2)

Luhmann
Luhmann

Reputation: 3890

You will need to create a global keyboard hook although be advised that this is not necessarily considered a good practice, and might cause issues with Anti-virus software.

Upvotes: 2

t0mm13b
t0mm13b

Reputation: 34592

Have a look here to see my answer in this keyboard hooking business here...in the link this OP was trying to find out how to hook the keyboard when running a VMWare session...In my answer I gave a couple of links pointing to the direction of CodeProject's articles on keyboard hooking.

Hope this helps, Best regards, Tom.

Upvotes: 0

Related Questions