ホーム › Media.Multimedia › mmioInstallIOProcW
mmioInstallIOProcW
関数カスタムMMIO入出力プロシージャを登録する(Unicode版)。
シグネチャ
// WINMM.dll (Unicode / -W)
#include <windows.h>
LPMMIOPROC mmioInstallIOProcW(
DWORD fccIOProc,
LPMMIOPROC pIOProc, // optional
DWORD dwFlags
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| fccIOProc | DWORD | in |
| pIOProc | LPMMIOPROC | inoptional |
| dwFlags | DWORD | in |
戻り値の型: LPMMIOPROC
各言語での呼び出し定義
// WINMM.dll (Unicode / -W)
#include <windows.h>
LPMMIOPROC mmioInstallIOProcW(
DWORD fccIOProc,
LPMMIOPROC pIOProc, // optional
DWORD dwFlags
);[DllImport("WINMM.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern IntPtr mmioInstallIOProcW(
uint fccIOProc, // DWORD
IntPtr pIOProc, // LPMMIOPROC optional
uint dwFlags // DWORD
);<DllImport("WINMM.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function mmioInstallIOProcW(
fccIOProc As UInteger, ' DWORD
pIOProc As IntPtr, ' LPMMIOPROC optional
dwFlags As UInteger ' DWORD
) As IntPtr
End Function' fccIOProc : DWORD
' pIOProc : LPMMIOPROC optional
' dwFlags : DWORD
Declare PtrSafe Function mmioInstallIOProcW Lib "winmm" ( _
ByVal fccIOProc As Long, _
ByVal pIOProc As LongPtr, _
ByVal dwFlags As Long) As LongPtr
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
mmioInstallIOProcW = ctypes.windll.winmm.mmioInstallIOProcW
mmioInstallIOProcW.restype = ctypes.c_void_p
mmioInstallIOProcW.argtypes = [
wintypes.DWORD, # fccIOProc : DWORD
ctypes.c_void_p, # pIOProc : LPMMIOPROC optional
wintypes.DWORD, # dwFlags : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WINMM.dll')
mmioInstallIOProcW = Fiddle::Function.new(
lib['mmioInstallIOProcW'],
[
-Fiddle::TYPE_INT, # fccIOProc : DWORD
Fiddle::TYPE_VOIDP, # pIOProc : LPMMIOPROC optional
-Fiddle::TYPE_INT, # dwFlags : DWORD
],
Fiddle::TYPE_VOIDP)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "winmm")]
extern "system" {
fn mmioInstallIOProcW(
fccIOProc: u32, // DWORD
pIOProc: *const core::ffi::c_void, // LPMMIOPROC optional
dwFlags: u32 // DWORD
) -> *const core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WINMM.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr mmioInstallIOProcW(uint fccIOProc, IntPtr pIOProc, uint dwFlags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINMM_mmioInstallIOProcW' -Namespace Win32 -PassThru
# $api::mmioInstallIOProcW(fccIOProc, pIOProc, dwFlags)#uselib "WINMM.dll"
#func global mmioInstallIOProcW "mmioInstallIOProcW" wptr, wptr, wptr
; mmioInstallIOProcW fccIOProc, pIOProc, dwFlags ; 戻り値は stat
; fccIOProc : DWORD -> "wptr"
; pIOProc : LPMMIOPROC optional -> "wptr"
; dwFlags : DWORD -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WINMM.dll"
#cfunc global mmioInstallIOProcW "mmioInstallIOProcW" int, sptr, int
; res = mmioInstallIOProcW(fccIOProc, pIOProc, dwFlags)
; fccIOProc : DWORD -> "int"
; pIOProc : LPMMIOPROC optional -> "sptr"
; dwFlags : DWORD -> "int"; LPMMIOPROC mmioInstallIOProcW(DWORD fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags)
#uselib "WINMM.dll"
#cfunc global mmioInstallIOProcW "mmioInstallIOProcW" int, intptr, int
; res = mmioInstallIOProcW(fccIOProc, pIOProc, dwFlags)
; fccIOProc : DWORD -> "int"
; pIOProc : LPMMIOPROC optional -> "intptr"
; dwFlags : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winmm = windows.NewLazySystemDLL("WINMM.dll")
procmmioInstallIOProcW = winmm.NewProc("mmioInstallIOProcW")
)
// fccIOProc (DWORD), pIOProc (LPMMIOPROC optional), dwFlags (DWORD)
r1, _, err := procmmioInstallIOProcW.Call(
uintptr(fccIOProc),
uintptr(pIOProc),
uintptr(dwFlags),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // LPMMIOPROCfunction mmioInstallIOProcW(
fccIOProc: DWORD; // DWORD
pIOProc: Pointer; // LPMMIOPROC optional
dwFlags: DWORD // DWORD
): Pointer; stdcall;
external 'WINMM.dll' name 'mmioInstallIOProcW';result := DllCall("WINMM\mmioInstallIOProcW"
, "UInt", fccIOProc ; DWORD
, "Ptr", pIOProc ; LPMMIOPROC optional
, "UInt", dwFlags ; DWORD
, "Ptr") ; return: LPMMIOPROC●mmioInstallIOProcW(fccIOProc, pIOProc, dwFlags) = DLL("WINMM.dll", "void* mmioInstallIOProcW(dword, void*, dword)")
# 呼び出し: mmioInstallIOProcW(fccIOProc, pIOProc, dwFlags)
# fccIOProc : DWORD -> "dword"
# pIOProc : LPMMIOPROC optional -> "void*"
# dwFlags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。