How to programmatically set WMP the default player of Windows Vista and Windows 7?

Here is the API that one can use to set the default playback application of Windows Vista and Windows 7:

IApplicationAssociationRegistration::SetAppAsDefaultAll Method

This method takes only one parameter - a pointer to a null-terminated Unicode string that specifies the registered name of the application. In this case it will be “Windows Media Player”.