Win32 API 日本語リファレンス
ホームMedia.Audio › midiOutClose

midiOutClose

関数
MIDI出力デバイスを閉じる。
DLLWINMM.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// WINMM.dll
#include <windows.h>

DWORD midiOutClose(
    HMIDIOUT hmo
);

パラメーター

名前方向
hmoHMIDIOUTin

戻り値の型: DWORD

各言語での呼び出し定義

// WINMM.dll
#include <windows.h>

DWORD midiOutClose(
    HMIDIOUT hmo
);
[DllImport("WINMM.dll", ExactSpelling = true)]
static extern uint midiOutClose(
    IntPtr hmo   // HMIDIOUT
);
<DllImport("WINMM.dll", ExactSpelling:=True)>
Public Shared Function midiOutClose(
    hmo As IntPtr   ' HMIDIOUT
) As UInteger
End Function
' hmo : HMIDIOUT
Declare PtrSafe Function midiOutClose Lib "winmm" ( _
    ByVal hmo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

midiOutClose = ctypes.windll.winmm.midiOutClose
midiOutClose.restype = wintypes.DWORD
midiOutClose.argtypes = [
    wintypes.HANDLE,  # hmo : HMIDIOUT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WINMM.dll')
midiOutClose = Fiddle::Function.new(
  lib['midiOutClose'],
  [
    Fiddle::TYPE_VOIDP,  # hmo : HMIDIOUT
  ],
  -Fiddle::TYPE_INT)
#[link(name = "winmm")]
extern "system" {
    fn midiOutClose(
        hmo: *mut core::ffi::c_void  // HMIDIOUT
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WINMM.dll")]
public static extern uint midiOutClose(IntPtr hmo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINMM_midiOutClose' -Namespace Win32 -PassThru
# $api::midiOutClose(hmo)
#uselib "WINMM.dll"
#func global midiOutClose "midiOutClose" sptr
; midiOutClose hmo   ; 戻り値は stat
; hmo : HMIDIOUT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WINMM.dll"
#cfunc global midiOutClose "midiOutClose" sptr
; res = midiOutClose(hmo)
; hmo : HMIDIOUT -> "sptr"
; DWORD midiOutClose(HMIDIOUT hmo)
#uselib "WINMM.dll"
#cfunc global midiOutClose "midiOutClose" intptr
; res = midiOutClose(hmo)
; hmo : HMIDIOUT -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	winmm = windows.NewLazySystemDLL("WINMM.dll")
	procmidiOutClose = winmm.NewProc("midiOutClose")
)

// hmo (HMIDIOUT)
r1, _, err := procmidiOutClose.Call(
	uintptr(hmo),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function midiOutClose(
  hmo: THandle   // HMIDIOUT
): DWORD; stdcall;
  external 'WINMM.dll' name 'midiOutClose';
result := DllCall("WINMM\midiOutClose"
    , "Ptr", hmo   ; HMIDIOUT
    , "UInt")   ; return: DWORD
●midiOutClose(hmo) = DLL("WINMM.dll", "dword midiOutClose(void*)")
# 呼び出し: midiOutClose(hmo)
# hmo : HMIDIOUT -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。