ホーム › Media.Audio › midiOutLongMsg
midiOutLongMsg
関数システムエクスクルーシブ等のMIDIロングメッセージを送信する。
シグネチャ
// WINMM.dll
#include <windows.h>
DWORD midiOutLongMsg(
HMIDIOUT hmo,
MIDIHDR* pmh,
DWORD cbmh
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hmo | HMIDIOUT | in |
| pmh | MIDIHDR* | in |
| cbmh | DWORD | in |
戻り値の型: DWORD
各言語での呼び出し定義
// WINMM.dll
#include <windows.h>
DWORD midiOutLongMsg(
HMIDIOUT hmo,
MIDIHDR* pmh,
DWORD cbmh
);[DllImport("WINMM.dll", ExactSpelling = true)]
static extern uint midiOutLongMsg(
IntPtr hmo, // HMIDIOUT
IntPtr pmh, // MIDIHDR*
uint cbmh // DWORD
);<DllImport("WINMM.dll", ExactSpelling:=True)>
Public Shared Function midiOutLongMsg(
hmo As IntPtr, ' HMIDIOUT
pmh As IntPtr, ' MIDIHDR*
cbmh As UInteger ' DWORD
) As UInteger
End Function' hmo : HMIDIOUT
' pmh : MIDIHDR*
' cbmh : DWORD
Declare PtrSafe Function midiOutLongMsg Lib "winmm" ( _
ByVal hmo As LongPtr, _
ByVal pmh As LongPtr, _
ByVal cbmh As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
midiOutLongMsg = ctypes.windll.winmm.midiOutLongMsg
midiOutLongMsg.restype = wintypes.DWORD
midiOutLongMsg.argtypes = [
wintypes.HANDLE, # hmo : HMIDIOUT
ctypes.c_void_p, # pmh : MIDIHDR*
wintypes.DWORD, # cbmh : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WINMM.dll')
midiOutLongMsg = Fiddle::Function.new(
lib['midiOutLongMsg'],
[
Fiddle::TYPE_VOIDP, # hmo : HMIDIOUT
Fiddle::TYPE_VOIDP, # pmh : MIDIHDR*
-Fiddle::TYPE_INT, # cbmh : DWORD
],
-Fiddle::TYPE_INT)#[link(name = "winmm")]
extern "system" {
fn midiOutLongMsg(
hmo: *mut core::ffi::c_void, // HMIDIOUT
pmh: *mut MIDIHDR, // MIDIHDR*
cbmh: u32 // DWORD
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WINMM.dll")]
public static extern uint midiOutLongMsg(IntPtr hmo, IntPtr pmh, uint cbmh);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINMM_midiOutLongMsg' -Namespace Win32 -PassThru
# $api::midiOutLongMsg(hmo, pmh, cbmh)#uselib "WINMM.dll"
#func global midiOutLongMsg "midiOutLongMsg" sptr, sptr, sptr
; midiOutLongMsg hmo, varptr(pmh), cbmh ; 戻り値は stat
; hmo : HMIDIOUT -> "sptr"
; pmh : MIDIHDR* -> "sptr"
; cbmh : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WINMM.dll" #cfunc global midiOutLongMsg "midiOutLongMsg" sptr, var, int ; res = midiOutLongMsg(hmo, pmh, cbmh) ; hmo : HMIDIOUT -> "sptr" ; pmh : MIDIHDR* -> "var" ; cbmh : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WINMM.dll" #cfunc global midiOutLongMsg "midiOutLongMsg" sptr, sptr, int ; res = midiOutLongMsg(hmo, varptr(pmh), cbmh) ; hmo : HMIDIOUT -> "sptr" ; pmh : MIDIHDR* -> "sptr" ; cbmh : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD midiOutLongMsg(HMIDIOUT hmo, MIDIHDR* pmh, DWORD cbmh) #uselib "WINMM.dll" #cfunc global midiOutLongMsg "midiOutLongMsg" intptr, var, int ; res = midiOutLongMsg(hmo, pmh, cbmh) ; hmo : HMIDIOUT -> "intptr" ; pmh : MIDIHDR* -> "var" ; cbmh : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD midiOutLongMsg(HMIDIOUT hmo, MIDIHDR* pmh, DWORD cbmh) #uselib "WINMM.dll" #cfunc global midiOutLongMsg "midiOutLongMsg" intptr, intptr, int ; res = midiOutLongMsg(hmo, varptr(pmh), cbmh) ; hmo : HMIDIOUT -> "intptr" ; pmh : MIDIHDR* -> "intptr" ; cbmh : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winmm = windows.NewLazySystemDLL("WINMM.dll")
procmidiOutLongMsg = winmm.NewProc("midiOutLongMsg")
)
// hmo (HMIDIOUT), pmh (MIDIHDR*), cbmh (DWORD)
r1, _, err := procmidiOutLongMsg.Call(
uintptr(hmo),
uintptr(pmh),
uintptr(cbmh),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction midiOutLongMsg(
hmo: THandle; // HMIDIOUT
pmh: Pointer; // MIDIHDR*
cbmh: DWORD // DWORD
): DWORD; stdcall;
external 'WINMM.dll' name 'midiOutLongMsg';result := DllCall("WINMM\midiOutLongMsg"
, "Ptr", hmo ; HMIDIOUT
, "Ptr", pmh ; MIDIHDR*
, "UInt", cbmh ; DWORD
, "UInt") ; return: DWORD●midiOutLongMsg(hmo, pmh, cbmh) = DLL("WINMM.dll", "dword midiOutLongMsg(void*, void*, dword)")
# 呼び出し: midiOutLongMsg(hmo, pmh, cbmh)
# hmo : HMIDIOUT -> "void*"
# pmh : MIDIHDR* -> "void*"
# cbmh : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。