Tip:
Because the callback function is accessed during the interruption time, it must be in the DLL; the data to be accessed must be in a fixed data segment;
Postmessage
Timegetsystemtime
Timegettime
Timesetevent
Timekillevent
Midioutshortmsg
Midioutlongmsg
Outputdebugstring cannot be called by other systems.
// Declaration: midioutopen (lphmidiout: phmidiout; {the pointer used to return the device handle; this handle should be used to call other functions later} udeviceid: uint; {Device ID; you can specify midi_mapper = uint (-1);} dwcallback: DWORD {callback function address or window handle. If the callback mechanism is not used, set it to nil} dwinstance: DWORD {instance data for the callback function; not used in the window} dwflags: DWORD {open option}): mmresult; {0 is returned for success; possible error values can be found below :} mmsyserr_baddeviceid = 2; {Device ID} mmsyserr_allocated = 4; {the specified resource has been allocated} mmsyserr_nomem = 7; {memory cannot be allocated or locked} midierr_nomap = 66; {No MIDI ing is currently available. Only the Program of the ing is enabled.} midierr_nodevice = 68; {the port in the Midi ing does not exist, it is only possible to open the ing program} // optional value of the open option dwflags: callback_null = $00000000; {specified when dwcallback is nil} callback_window = $00010000; {When dwcallback is a window handle, specify} callback_function = $00030000; {When dwcallback is a function pointer} // if you select a window to receive callback information, messages that may be sent to the window include: mm_mom_open = $3c7; mm_mom_close = $3c8; mm_mom_done = $3c9; // if you select a function to receive callback information, the messages that may be sent to the function include: mom_open = mm_mom_open; mom_close = mm_mom_close; mom_done = mm_mom_done;
// example: