ホーム › Media.Multimedia › mciGetDeviceIDA
mciGetDeviceIDA
関数デバイス名からMCIデバイスIDを取得する(ANSI版)。
シグネチャ
// WINMM.dll (ANSI / -A)
#include <windows.h>
DWORD mciGetDeviceIDA(
LPCSTR pszDevice
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pszDevice | LPCSTR | in |
戻り値の型: DWORD
各言語での呼び出し定義
// WINMM.dll (ANSI / -A)
#include <windows.h>
DWORD mciGetDeviceIDA(
LPCSTR pszDevice
);[DllImport("WINMM.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern uint mciGetDeviceIDA(
[MarshalAs(UnmanagedType.LPStr)] string pszDevice // LPCSTR
);<DllImport("WINMM.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function mciGetDeviceIDA(
<MarshalAs(UnmanagedType.LPStr)> pszDevice As String ' LPCSTR
) As UInteger
End Function' pszDevice : LPCSTR
Declare PtrSafe Function mciGetDeviceIDA Lib "winmm" ( _
ByVal pszDevice As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
mciGetDeviceIDA = ctypes.windll.winmm.mciGetDeviceIDA
mciGetDeviceIDA.restype = wintypes.DWORD
mciGetDeviceIDA.argtypes = [
wintypes.LPCSTR, # pszDevice : LPCSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WINMM.dll')
mciGetDeviceIDA = Fiddle::Function.new(
lib['mciGetDeviceIDA'],
[
Fiddle::TYPE_VOIDP, # pszDevice : LPCSTR
],
-Fiddle::TYPE_INT)#[link(name = "winmm")]
extern "system" {
fn mciGetDeviceIDA(
pszDevice: *const u8 // LPCSTR
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WINMM.dll", CharSet = CharSet.Ansi)]
public static extern uint mciGetDeviceIDA([MarshalAs(UnmanagedType.LPStr)] string pszDevice);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINMM_mciGetDeviceIDA' -Namespace Win32 -PassThru
# $api::mciGetDeviceIDA(pszDevice)#uselib "WINMM.dll"
#func global mciGetDeviceIDA "mciGetDeviceIDA" sptr
; mciGetDeviceIDA pszDevice ; 戻り値は stat
; pszDevice : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WINMM.dll"
#cfunc global mciGetDeviceIDA "mciGetDeviceIDA" str
; res = mciGetDeviceIDA(pszDevice)
; pszDevice : LPCSTR -> "str"; DWORD mciGetDeviceIDA(LPCSTR pszDevice)
#uselib "WINMM.dll"
#cfunc global mciGetDeviceIDA "mciGetDeviceIDA" str
; res = mciGetDeviceIDA(pszDevice)
; pszDevice : LPCSTR -> "str"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winmm = windows.NewLazySystemDLL("WINMM.dll")
procmciGetDeviceIDA = winmm.NewProc("mciGetDeviceIDA")
)
// pszDevice (LPCSTR)
r1, _, err := procmciGetDeviceIDA.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(pszDevice))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction mciGetDeviceIDA(
pszDevice: PAnsiChar // LPCSTR
): DWORD; stdcall;
external 'WINMM.dll' name 'mciGetDeviceIDA';result := DllCall("WINMM\mciGetDeviceIDA"
, "AStr", pszDevice ; LPCSTR
, "UInt") ; return: DWORD●mciGetDeviceIDA(pszDevice) = DLL("WINMM.dll", "dword mciGetDeviceIDA(char*)")
# 呼び出し: mciGetDeviceIDA(pszDevice)
# pszDevice : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。