ホーム › Devices.Tapi › phoneGetDevCaps
phoneGetDevCaps
関数電話デバイスの機能と性能(デバイス能力)を取得する。
シグネチャ
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT phoneGetDevCaps(
DWORD hPhoneApp,
DWORD dwDeviceID,
DWORD dwAPIVersion,
DWORD dwExtVersion,
PHONECAPS* lpPhoneCaps
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hPhoneApp | DWORD | in |
| dwDeviceID | DWORD | in |
| dwAPIVersion | DWORD | in |
| dwExtVersion | DWORD | in |
| lpPhoneCaps | PHONECAPS* | inout |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT phoneGetDevCaps(
DWORD hPhoneApp,
DWORD dwDeviceID,
DWORD dwAPIVersion,
DWORD dwExtVersion,
PHONECAPS* lpPhoneCaps
);[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int phoneGetDevCaps(
uint hPhoneApp, // DWORD
uint dwDeviceID, // DWORD
uint dwAPIVersion, // DWORD
uint dwExtVersion, // DWORD
IntPtr lpPhoneCaps // PHONECAPS* in/out
);<DllImport("TAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function phoneGetDevCaps(
hPhoneApp As UInteger, ' DWORD
dwDeviceID As UInteger, ' DWORD
dwAPIVersion As UInteger, ' DWORD
dwExtVersion As UInteger, ' DWORD
lpPhoneCaps As IntPtr ' PHONECAPS* in/out
) As Integer
End Function' hPhoneApp : DWORD
' dwDeviceID : DWORD
' dwAPIVersion : DWORD
' dwExtVersion : DWORD
' lpPhoneCaps : PHONECAPS* in/out
Declare PtrSafe Function phoneGetDevCaps Lib "tapi32" ( _
ByVal hPhoneApp As Long, _
ByVal dwDeviceID As Long, _
ByVal dwAPIVersion As Long, _
ByVal dwExtVersion As Long, _
ByVal lpPhoneCaps As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
phoneGetDevCaps = ctypes.windll.tapi32.phoneGetDevCaps
phoneGetDevCaps.restype = ctypes.c_int
phoneGetDevCaps.argtypes = [
wintypes.DWORD, # hPhoneApp : DWORD
wintypes.DWORD, # dwDeviceID : DWORD
wintypes.DWORD, # dwAPIVersion : DWORD
wintypes.DWORD, # dwExtVersion : DWORD
ctypes.c_void_p, # lpPhoneCaps : PHONECAPS* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
phoneGetDevCaps = Fiddle::Function.new(
lib['phoneGetDevCaps'],
[
-Fiddle::TYPE_INT, # hPhoneApp : DWORD
-Fiddle::TYPE_INT, # dwDeviceID : DWORD
-Fiddle::TYPE_INT, # dwAPIVersion : DWORD
-Fiddle::TYPE_INT, # dwExtVersion : DWORD
Fiddle::TYPE_VOIDP, # lpPhoneCaps : PHONECAPS* in/out
],
Fiddle::TYPE_INT)#[link(name = "tapi32")]
extern "system" {
fn phoneGetDevCaps(
hPhoneApp: u32, // DWORD
dwDeviceID: u32, // DWORD
dwAPIVersion: u32, // DWORD
dwExtVersion: u32, // DWORD
lpPhoneCaps: *mut PHONECAPS // PHONECAPS* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi)]
public static extern int phoneGetDevCaps(uint hPhoneApp, uint dwDeviceID, uint dwAPIVersion, uint dwExtVersion, IntPtr lpPhoneCaps);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_phoneGetDevCaps' -Namespace Win32 -PassThru
# $api::phoneGetDevCaps(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtVersion, lpPhoneCaps)#uselib "TAPI32.dll"
#func global phoneGetDevCaps "phoneGetDevCaps" sptr, sptr, sptr, sptr, sptr
; phoneGetDevCaps hPhoneApp, dwDeviceID, dwAPIVersion, dwExtVersion, varptr(lpPhoneCaps) ; 戻り値は stat
; hPhoneApp : DWORD -> "sptr"
; dwDeviceID : DWORD -> "sptr"
; dwAPIVersion : DWORD -> "sptr"
; dwExtVersion : DWORD -> "sptr"
; lpPhoneCaps : PHONECAPS* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "TAPI32.dll" #cfunc global phoneGetDevCaps "phoneGetDevCaps" int, int, int, int, var ; res = phoneGetDevCaps(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtVersion, lpPhoneCaps) ; hPhoneApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAPIVersion : DWORD -> "int" ; dwExtVersion : DWORD -> "int" ; lpPhoneCaps : PHONECAPS* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "TAPI32.dll" #cfunc global phoneGetDevCaps "phoneGetDevCaps" int, int, int, int, sptr ; res = phoneGetDevCaps(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtVersion, varptr(lpPhoneCaps)) ; hPhoneApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAPIVersion : DWORD -> "int" ; dwExtVersion : DWORD -> "int" ; lpPhoneCaps : PHONECAPS* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT phoneGetDevCaps(DWORD hPhoneApp, DWORD dwDeviceID, DWORD dwAPIVersion, DWORD dwExtVersion, PHONECAPS* lpPhoneCaps) #uselib "TAPI32.dll" #cfunc global phoneGetDevCaps "phoneGetDevCaps" int, int, int, int, var ; res = phoneGetDevCaps(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtVersion, lpPhoneCaps) ; hPhoneApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAPIVersion : DWORD -> "int" ; dwExtVersion : DWORD -> "int" ; lpPhoneCaps : PHONECAPS* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT phoneGetDevCaps(DWORD hPhoneApp, DWORD dwDeviceID, DWORD dwAPIVersion, DWORD dwExtVersion, PHONECAPS* lpPhoneCaps) #uselib "TAPI32.dll" #cfunc global phoneGetDevCaps "phoneGetDevCaps" int, int, int, int, intptr ; res = phoneGetDevCaps(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtVersion, varptr(lpPhoneCaps)) ; hPhoneApp : DWORD -> "int" ; dwDeviceID : DWORD -> "int" ; dwAPIVersion : DWORD -> "int" ; dwExtVersion : DWORD -> "int" ; lpPhoneCaps : PHONECAPS* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
procphoneGetDevCaps = tapi32.NewProc("phoneGetDevCaps")
)
// hPhoneApp (DWORD), dwDeviceID (DWORD), dwAPIVersion (DWORD), dwExtVersion (DWORD), lpPhoneCaps (PHONECAPS* in/out)
r1, _, err := procphoneGetDevCaps.Call(
uintptr(hPhoneApp),
uintptr(dwDeviceID),
uintptr(dwAPIVersion),
uintptr(dwExtVersion),
uintptr(lpPhoneCaps),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction phoneGetDevCaps(
hPhoneApp: DWORD; // DWORD
dwDeviceID: DWORD; // DWORD
dwAPIVersion: DWORD; // DWORD
dwExtVersion: DWORD; // DWORD
lpPhoneCaps: Pointer // PHONECAPS* in/out
): Integer; stdcall;
external 'TAPI32.dll' name 'phoneGetDevCaps';result := DllCall("TAPI32\phoneGetDevCaps"
, "UInt", hPhoneApp ; DWORD
, "UInt", dwDeviceID ; DWORD
, "UInt", dwAPIVersion ; DWORD
, "UInt", dwExtVersion ; DWORD
, "Ptr", lpPhoneCaps ; PHONECAPS* in/out
, "Int") ; return: INT●phoneGetDevCaps(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtVersion, lpPhoneCaps) = DLL("TAPI32.dll", "int phoneGetDevCaps(dword, dword, dword, dword, void*)")
# 呼び出し: phoneGetDevCaps(hPhoneApp, dwDeviceID, dwAPIVersion, dwExtVersion, lpPhoneCaps)
# hPhoneApp : DWORD -> "dword"
# dwDeviceID : DWORD -> "dword"
# dwAPIVersion : DWORD -> "dword"
# dwExtVersion : DWORD -> "dword"
# lpPhoneCaps : PHONECAPS* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。