Lots of keyboards have common media functions like next/previous, play/pause and stop. Do they use some existing API in Windows, or do they implement functions specific to the most popular media players (WMP, WinAmp, Spotify...)? All keyboards I've owned which have this functionality have just seemed to work with everything, regardless of age of the keyboard vs the software, so I thought there might be an already built API for this.

If they use an already existing API in Windows, where can I find info about it?

Just to clarify: I'm not looking for a way to interact with Windows Media player specifically. I want to find that one magic button to hit to reach all (supported) media players - if one such exists.