I’m writing an app to control an existing instance of WMP using C#.
Currently my code goes something like this:
private const int WM_COMMAND = 0x111;
private const int WMP9_PLAY = 0x4978;
SendMessage(WMP.MainWindowHandle, WM_COMMAND, WMP9_PLAY, 0);
This works fine for pausing media player, but if media player is paused or stopped, it skips to the next track. The command is called play, but I could have the wrong value for it. Does anyone either have a better value for WMP9_PLAY, or a better way to make WMP play?
By using Spy++ (from the answer above) I was able to find another set of SendMessage parameters that is sent when you press the play/pause on a windows keyboard that does the job: