Winapi: midiinopen-enable the MIDI input device

Source: Internet
Author: User
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: midiinopen (lphmidiin: phmidiin; {pointer used to return the device handle; then call other functions to use this handle} udeviceid: uint; {Device ID; it cannot be specified as the constant 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} // optional dwflags value: 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_mim_open = $3c1; mm_mim_close = $3c2; mm_mim_data = $3c3; mm_mim_longdata = $3c4; mm_mim_error = $3c5; callback = $3c6; // if you select a function to accept callback information, messages may be sent to the function: mim_open = mm_mim_open; mim_close = mm_mim_close; mim_data = mm_mim_data; mim_longdata = mm_mim_longdata; mim_error = mm_mim_error; mim_longerror = timeout;
  
   
 // Example:
  
   
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.