Copyright © 2013-2014 MultiMedia Soft

MidiVirtualKeyboard.MidiInputConnect method

Previous pageReturn to chapter overviewNext page



Connects the virtual piano keyboard to the given MIDI input device. After the connection is established, the connected MIDI input device can be disconnected through the MidiVirtualKeyboard.MidiInputDisconnect method.


In order to establish the connection, the involved input device must have been previously opened through the MidiDevices.Open method.


For further details about the use of the virtual MIDI keyboard see the MidiVirtualKeyboard object section and the How to manage the virtual MIDI piano keyboard tutorial.





[Visual Basic]

control.MidiVirtualKeyboard.MidiInputConnect (

hWndKeyboard as OLE_HANDLE,

nDeviceUniqueId as Integer

) as enumDjcErrorCodes



short control.MidiVirtualKeyboard.MidiInputConnect (

OLE_HANDLE hWndKeyboard,

short nDeviceUniqueId










Handle of the virtual keyboard as returned by the call to the MidiVirtualKeyboard.Create method


The unique identifier of the MIDI input device returned by a previous call to the MidiDevices.Open method



Return value






enumDjcErrorCodes.ERR_DJC_NOERROR (0)

The call was successful.

Negative value

An error occurred: see the LastError property for further error details or for a list of the possible error values.