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