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