midiOutOpen (winmm)
Last changed: -

The midiOutOpen function opens a MIDI output device for playback.

C# Signature:

    static extern uint midiOutOpen(out IntPtr lphMidiOut, uint uDeviceID, IntPtr dwCallback, IntPtr dwInstance, uint dwFlags);

VB Signature:

    <DllImport("winmm.dll")> Shared Function midiOutOpen(ByRef lphMidiOut As IntPtr, ByVal uDeviceID As UInteger, ByVal dwCallback As IntPtr, ByVal dwInstance As IntPtr, ByVal dwFlags As UInteger) As UInteger
    End Function

User-Defined Types:


Alternative Managed API:

Do you know one? Please contribute it!


The device should be disposed with midiOutClose when not needed anymore.

Tips & Tricks:

Please add some!

Sample Code:

IntPtr hmidi;

midiOutOpen(out hmidi, 0, IntPtr.Zero, IntPtr.Zero, 0);

//hmidi is now a valid pointer to MIDI device 0.

midiOutOpen on MSDN