Key handling outside application?

A

aeron005

Hello, I am developing an application, mainly for personal use, that
runs in the system tray, organizes data (calendar, etc.), and has
several useful widgets included (little scratch pads and stuff). I
would like to add a feature where I, as the end user, can set custom
hotkeys to run different applications, etc.

The only problem is, using the normal key event handlers (to my
knowledge) can only be detected when that control is active. So is
there any way to read key event handlers outside the application (or
has is this not possible for security measures)?

Thanks in advance,
-aeron
 
R

rowe_newsgroups

You are pretty much looking for a keylogger, although (I hope) you are
using it for honest means. I know a lot of free keylogging source code
exists for VB6, although I don't know of any of .Net but I also haven't
looked for any. I would recommend doing some google searches for
"keylogger source code" or something similar. If you don't find any
thing let us know - I have some old keylogger-type code laying around
somewhere that I could dig up if need be.

Thanks,

Seth Rowe
 
A

aeron005

Ah. That's what I was afraid of... well I looked around and found some
code snippets that (I think) can do what I want, so I'll mess with that
for now. It shouldn't be too hard, I just need to check if a certain
combination was last pressed and it should activate the corresponding
action. I hope it's as simple as it sounds...

Thanks for your reply!
 
J

Juan Romero

What you are looking for is Windows Hooks. You need to set a keyboard hook
using the Windows API that will intercept all the key presses. Google it and
you will find some interesting articles. Just make sure you release the hook
afterwards.

Good luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top