The Multimedia extensions provide the following functions you can use when sending MCI command messages:
mciSendCommand
Sends a command message to an MCI device.
mciGetDeviceID
Returns the device ID assigned when the device was opened.
mciGetErrorString
Returns the error string corresponding to an error number.