Using a MIDI device handle, you can retrieve the device ID for an open MIDI device. Use the following functions to get the device ID:
midiInGetID
Gets the device ID for a MIDI input device.
midiOutGetID
Gets the device ID for a MIDI output device.