E.g. with winamp (on Windows at least), you can play a game fullscreen with winamp in the background, and use the media buttons* to control the sound. Winamp doesn’t need to get focus, allowing the game to continue fullscreen.
I’d prefer to write this in Java but that probably isn’t going to work (capturing keystrokes without focus is already difficult in Java afaik), so any C# solution is also fine.
So the basic question is: how to capture keystrokes without focus?
*) I believe the ‘back/forward/stop/mail/search/favorites/web/home’ buttons are called media buttons, but a better name would be welcome :).
Low-Level windows hooks is one way to do it. Here is one article and here is a little more info from MSDN.
This is a partial view of what that code can look like:
Just implement all the P/Invoke declarations needed, and it should work.
I use this approach in my application and it works fine.