Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture keys

Status
Not open for further replies.

virtualoverride

Programmer
May 29, 2005
3
US
I'm designing a program that runs in the system tray and it would be convenient to have some hotkeys to do a few things. However, since the program runs in the background (i.e. the window is generally invisible), my program does not have the input focus--which makes it very difficult to process keyboard events! Follow me?
I'm wondering if there's some way to capture keyboard events from the system and process hotkeys regardless of what window has the focus--it's the only way to implement hotkeys for a program that runs in the background like mine does.
I used a program called WinKey for a while that performs basically what I want to do ( wondering how they did it. I think it has something to do with shell extensions?? Any ideas that might point me in the right direction would be very appreciated...
Thanks--
Andrew
 
Look up global keyboard hooks on MSDN. You'll need to write a DLL to do this, but don't worry, it's not all that difficult.
 
Thanks! It's not exactly light reading, but I'm heading in the right direction now.
Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top