I'm just getting out from those problems... DirectInput is not very compatible with the system input. :?

You could do it in 2 ways:

1. Capture messages in a normal VCL application, as suggested by Delfi, or

2. Make your own window processing loop in a formless application.

If you follow the first path, first learn about capturing and processing messages with a TForm:

http://www.informit.com/articles/art...&seqNum=1&rl=1

If you follow the second path, read this tutorial about creating a formless app:

http://delphi.about.com/od/windowssh.../apicourse.htm