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

auxOutMessage

関数
補助オーディオ出力デバイスドライバーへメッセージを送信する。
DLLWINMM.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD auxOutMessage(
    DWORD uDeviceID,
    DWORD uMsg,
    UINT_PTR dw1,   // optional
    UINT_PTR dw2   // optional
);

パラメーター

名前方向
uDeviceIDDWORDin
uMsgDWORDin
dw1UINT_PTRinoptional
dw2UINT_PTRinoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

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

auxOutMessage = ctypes.windll.winmm.auxOutMessage
auxOutMessage.restype = wintypes.DWORD
auxOutMessage.argtypes = [
    wintypes.DWORD,  # uDeviceID : DWORD
    wintypes.DWORD,  # uMsg : DWORD
    ctypes.c_size_t,  # dw1 : UINT_PTR optional
    ctypes.c_size_t,  # dw2 : UINT_PTR optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	winmm = windows.NewLazySystemDLL("WINMM.dll")
	procauxOutMessage = winmm.NewProc("auxOutMessage")
)

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