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