Step 1: Associate foobar with .cda files however you see fit (from foobar's preferences is an easy way to do it). That's it!

Testing: Press the "launch multimedia application" button on your keyboard. If foobar is open it should jump to the foreground, if not it should open. If it worked, jump to the "It worked!" section. If it didn't, try the troubleshooting section and if it still doesn't work, try the "It didn't work!" section.

Technical note: Yes, Windows determines what program should be launched when you press "AppKey 16" (media player button) by what opens .cda files. It took a while to figure this out! This can actually be changed so it matches .mp3 files or whatever, just change HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey\16\Association (I give no warranty whatsoever for fiddling with this, nor have I tested doing so).

Part 2: Making the media player buttons (play, stop etc) work when foobar is minimised.

Step 1: Open preferences in foobar and go to General->Keyboard Shortcuts.

Step 2: Add a new shortcut for the function you want (in my case my keyboard has a combined play/pause button so I'm adding one for that).

Step 3: Select the function you want, in this case "Play or pause".

Step 4: Click in this box and press the button on your multimedia keyboard you want to associate with the shortcut. You should get something appearing here ending in (MM). If nothing appears, jump to the troubleshooting section.

Step 5: Check this box!

Testing: Minimise foobar, try buttons, see if they work. If they don't work, jump to the "It didn't work!" section. If they do work, jump to the "It worked!" section.

Troubleshooting:The number one thing to check is whether or not your media buttons work in foobar when the window is selected. If foobar is open, by default the media buttons (pause etc) should work - if they do not then either your keyboard is horribly non-standard (uncommon) or something else is hooking the keyboard call first (e.g. vendor keyboard drivers). I use my keyboard and mouse without the Logitech drivers installed for maximum compatibility, you should try disabling / uninstalling vendor drivers and / or applications if that's an option and seeing if that fixes it. If you do want to have SetPoint running, see the section on that to get it working. If people start having other problems, then I might write a number two thing to check

Addendum A: Logitech SetPoint

Firstly, SetPoint is a horrible, poorly written program that I would strongly advise against having installed. However, you can get your media buttons working in foobar while it is minimised with a small alteration. Open up SetPoint's "players.ini" file, for me this is in C:\Program Files\Logitech\SetPoint\players.ini. At the bottom of the [players] list, add the line:

Restart SetPoint (i.e. exit it, and then start it again), and your keys should work, if you're using foobar v0.9.4.1. The window class will need to be changed if you are not, or if you're using a different user interface module - e.g. for columnsui, the classid would be {E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}. The best long-term solution is for you to know how to find out that classid, so read on:

I used Spy++ to find the classid, but not all of you will have Visual Studio installed so I checked out some of the free options. WinID was the easiest to use: