ホーム › Media.Audio › waveInGetDevCapsW
waveInGetDevCapsW
関数波形オーディオ入力デバイスの機能を取得する(Unicode版)。
シグネチャ
// WINMM.dll (Unicode / -W)
#include <windows.h>
DWORD waveInGetDevCapsW(
UINT_PTR uDeviceID,
WAVEINCAPSW* pwic,
DWORD cbwic
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| uDeviceID | UINT_PTR | in |
| pwic | WAVEINCAPSW* | out |
| cbwic | DWORD | in |
戻り値の型: DWORD
各言語での呼び出し定義
// WINMM.dll (Unicode / -W)
#include <windows.h>
DWORD waveInGetDevCapsW(
UINT_PTR uDeviceID,
WAVEINCAPSW* pwic,
DWORD cbwic
);[DllImport("WINMM.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern uint waveInGetDevCapsW(
UIntPtr uDeviceID, // UINT_PTR
IntPtr pwic, // WAVEINCAPSW* out
uint cbwic // DWORD
);<DllImport("WINMM.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function waveInGetDevCapsW(
uDeviceID As UIntPtr, ' UINT_PTR
pwic As IntPtr, ' WAVEINCAPSW* out
cbwic As UInteger ' DWORD
) As UInteger
End Function' uDeviceID : UINT_PTR
' pwic : WAVEINCAPSW* out
' cbwic : DWORD
Declare PtrSafe Function waveInGetDevCapsW Lib "winmm" ( _
ByVal uDeviceID As LongPtr, _
ByVal pwic As LongPtr, _
ByVal cbwic As Long) As Long
' 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
waveInGetDevCapsW = ctypes.windll.winmm.waveInGetDevCapsW
waveInGetDevCapsW.restype = wintypes.DWORD
waveInGetDevCapsW.argtypes = [
ctypes.c_size_t, # uDeviceID : UINT_PTR
ctypes.c_void_p, # pwic : WAVEINCAPSW* out
wintypes.DWORD, # cbwic : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WINMM.dll')
waveInGetDevCapsW = Fiddle::Function.new(
lib['waveInGetDevCapsW'],
[
Fiddle::TYPE_UINTPTR_T, # uDeviceID : UINT_PTR
Fiddle::TYPE_VOIDP, # pwic : WAVEINCAPSW* out
-Fiddle::TYPE_INT, # cbwic : DWORD
],
-Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "winmm")]
extern "system" {
fn waveInGetDevCapsW(
uDeviceID: usize, // UINT_PTR
pwic: *mut WAVEINCAPSW, // WAVEINCAPSW* out
cbwic: u32 // DWORD
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WINMM.dll", CharSet = CharSet.Unicode)]
public static extern uint waveInGetDevCapsW(UIntPtr uDeviceID, IntPtr pwic, uint cbwic);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINMM_waveInGetDevCapsW' -Namespace Win32 -PassThru
# $api::waveInGetDevCapsW(uDeviceID, pwic, cbwic)#uselib "WINMM.dll"
#func global waveInGetDevCapsW "waveInGetDevCapsW" wptr, wptr, wptr
; waveInGetDevCapsW uDeviceID, varptr(pwic), cbwic ; 戻り値は stat
; uDeviceID : UINT_PTR -> "wptr"
; pwic : WAVEINCAPSW* out -> "wptr"
; cbwic : DWORD -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WINMM.dll" #cfunc global waveInGetDevCapsW "waveInGetDevCapsW" sptr, var, int ; res = waveInGetDevCapsW(uDeviceID, pwic, cbwic) ; uDeviceID : UINT_PTR -> "sptr" ; pwic : WAVEINCAPSW* out -> "var" ; cbwic : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WINMM.dll" #cfunc global waveInGetDevCapsW "waveInGetDevCapsW" sptr, sptr, int ; res = waveInGetDevCapsW(uDeviceID, varptr(pwic), cbwic) ; uDeviceID : UINT_PTR -> "sptr" ; pwic : WAVEINCAPSW* out -> "sptr" ; cbwic : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD waveInGetDevCapsW(UINT_PTR uDeviceID, WAVEINCAPSW* pwic, DWORD cbwic) #uselib "WINMM.dll" #cfunc global waveInGetDevCapsW "waveInGetDevCapsW" intptr, var, int ; res = waveInGetDevCapsW(uDeviceID, pwic, cbwic) ; uDeviceID : UINT_PTR -> "intptr" ; pwic : WAVEINCAPSW* out -> "var" ; cbwic : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD waveInGetDevCapsW(UINT_PTR uDeviceID, WAVEINCAPSW* pwic, DWORD cbwic) #uselib "WINMM.dll" #cfunc global waveInGetDevCapsW "waveInGetDevCapsW" intptr, intptr, int ; res = waveInGetDevCapsW(uDeviceID, varptr(pwic), cbwic) ; uDeviceID : UINT_PTR -> "intptr" ; pwic : WAVEINCAPSW* out -> "intptr" ; cbwic : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winmm = windows.NewLazySystemDLL("WINMM.dll")
procwaveInGetDevCapsW = winmm.NewProc("waveInGetDevCapsW")
)
// uDeviceID (UINT_PTR), pwic (WAVEINCAPSW* out), cbwic (DWORD)
r1, _, err := procwaveInGetDevCapsW.Call(
uintptr(uDeviceID),
uintptr(pwic),
uintptr(cbwic),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction waveInGetDevCapsW(
uDeviceID: NativeUInt; // UINT_PTR
pwic: Pointer; // WAVEINCAPSW* out
cbwic: DWORD // DWORD
): DWORD; stdcall;
external 'WINMM.dll' name 'waveInGetDevCapsW';result := DllCall("WINMM\waveInGetDevCapsW"
, "UPtr", uDeviceID ; UINT_PTR
, "Ptr", pwic ; WAVEINCAPSW* out
, "UInt", cbwic ; DWORD
, "UInt") ; return: DWORD●waveInGetDevCapsW(uDeviceID, pwic, cbwic) = DLL("WINMM.dll", "dword waveInGetDevCapsW(int, void*, dword)")
# 呼び出し: waveInGetDevCapsW(uDeviceID, pwic, cbwic)
# uDeviceID : UINT_PTR -> "int"
# pwic : WAVEINCAPSW* out -> "void*"
# cbwic : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。