The following code illustrates how to query the device ID of the ampmix device, which is consuming the digital audio data stream from a waveaudio device.
USHORT usWaveDeviceID; USHORT usAmpDeviceID; MCI_CONNECTION_PARMS connectionparms; connectionparms.ulConnectorType = MCI_WAVE_STREAM_CONNECTOR; /* Get the Amp/Mixer device ID */ mciSendCommand ( usWaveDeviceID, /* WaveAudio device ID */ MCI_CONNECTION, /* CONNECTION message */ MCI_QUERY_CONNECTION | MCI_WAIT, /* Flags for this msg */ (PVOID) &connectionparms, /* Data structure */ 0 ); /* No user parameter */ usAmpDeviceID = connectionparms.usToDeviceID; /* Device ID amp mixer */