midiDisconnect

The midiDisconnect function disconnects a MIDI input device from a MIDI thru or output device, or disconnects a MIDI thru device from a MIDI output device.

MMRESULT midiDisconnect(
  HMIDI hMidi,      
  HMIDIOUT hmo,     
  LPVOID pReserved  
);
 

Parameters

hMidi
Handle of a MIDI input device or a MIDI thru device.
hmo
Handle of the MIDI output device to be disconnected.
pReserved
Reserved; must be NULL.

Return Values

Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following:

Value Description
MMSYSERR_INVALHANDLE Specified device handle is invalid.

Remarks

MIDI input, output, and thru devices can be connected by using the midiConnect function. Thereafter, whenever the MIDI input device receives event data in an MIM_DATA message, a message with the same event data is sent to the output device driver (or through the thru driver to the output drivers).

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mmsystem.h.
  Import Library: Use winmm.lib.

See Also

Musical Instrument Digital Interface (MIDI) Overview, MIDI Functions, midiConnect, MIM_DATA