Trap events in other applications, or handle events
centrally within your own application.

Akemi Spy Library provides an easy way to trap
keyboard and mouse events within your own thread,
within a specific thread, or system wide. Can also
trap events whenever a window is activated or
receives focus.

Comes with online documentation and sample
code.

http://www.akemivb.com/products/SpyLibrary.php