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