Win32 API 日本語リファレンス
ホームDevices.Tapi › lineGetAgentStatusW

lineGetAgentStatusW

関数
アドレスのACDエージェントの現在の状態を取得する(Unicode版)。
DLLTAPI32.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

// TAPI32.dll  (Unicode / -W)
#include <windows.h>

INT lineGetAgentStatusW(
    DWORD hLine,
    DWORD dwAddressID,
    LINEAGENTSTATUS* lpAgentStatus
);

パラメーター

名前方向
hLineDWORDin
dwAddressIDDWORDin
lpAgentStatusLINEAGENTSTATUS*inout

戻り値の型: INT

各言語での呼び出し定義

// TAPI32.dll  (Unicode / -W)
#include <windows.h>

INT lineGetAgentStatusW(
    DWORD hLine,
    DWORD dwAddressID,
    LINEAGENTSTATUS* lpAgentStatus
);
[DllImport("TAPI32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int lineGetAgentStatusW(
    uint hLine,   // DWORD
    uint dwAddressID,   // DWORD
    IntPtr lpAgentStatus   // LINEAGENTSTATUS* in/out
);
<DllImport("TAPI32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function lineGetAgentStatusW(
    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 lineGetAgentStatusW Lib "tapi32" ( _
    ByVal hLine As Long, _
    ByVal dwAddressID As Long, _
    ByVal lpAgentStatus 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

lineGetAgentStatusW = ctypes.windll.tapi32.lineGetAgentStatusW
lineGetAgentStatusW.restype = ctypes.c_int
lineGetAgentStatusW.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')
lineGetAgentStatusW = Fiddle::Function.new(
  lib['lineGetAgentStatusW'],
  [
    -Fiddle::TYPE_INT,  # hLine : DWORD
    -Fiddle::TYPE_INT,  # dwAddressID : DWORD
    Fiddle::TYPE_VOIDP,  # lpAgentStatus : LINEAGENTSTATUS* in/out
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "tapi32")]
extern "system" {
    fn lineGetAgentStatusW(
        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.Unicode)]
public static extern int lineGetAgentStatusW(uint hLine, uint dwAddressID, IntPtr lpAgentStatus);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineGetAgentStatusW' -Namespace Win32 -PassThru
# $api::lineGetAgentStatusW(hLine, dwAddressID, lpAgentStatus)
#uselib "TAPI32.dll"
#func global lineGetAgentStatusW "lineGetAgentStatusW" wptr, wptr, wptr
; lineGetAgentStatusW hLine, dwAddressID, varptr(lpAgentStatus)   ; 戻り値は stat
; hLine : DWORD -> "wptr"
; dwAddressID : DWORD -> "wptr"
; lpAgentStatus : LINEAGENTSTATUS* in/out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "TAPI32.dll"
#cfunc global lineGetAgentStatusW "lineGetAgentStatusW" int, int, var
; res = lineGetAgentStatusW(hLine, dwAddressID, lpAgentStatus)
; hLine : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; lpAgentStatus : LINEAGENTSTATUS* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT lineGetAgentStatusW(DWORD hLine, DWORD dwAddressID, LINEAGENTSTATUS* lpAgentStatus)
#uselib "TAPI32.dll"
#cfunc global lineGetAgentStatusW "lineGetAgentStatusW" int, int, var
; res = lineGetAgentStatusW(hLine, dwAddressID, lpAgentStatus)
; hLine : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; lpAgentStatus : LINEAGENTSTATUS* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineGetAgentStatusW = tapi32.NewProc("lineGetAgentStatusW")
)

// hLine (DWORD), dwAddressID (DWORD), lpAgentStatus (LINEAGENTSTATUS* in/out)
r1, _, err := proclineGetAgentStatusW.Call(
	uintptr(hLine),
	uintptr(dwAddressID),
	uintptr(lpAgentStatus),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function lineGetAgentStatusW(
  hLine: DWORD;   // DWORD
  dwAddressID: DWORD;   // DWORD
  lpAgentStatus: Pointer   // LINEAGENTSTATUS* in/out
): Integer; stdcall;
  external 'TAPI32.dll' name 'lineGetAgentStatusW';
result := DllCall("TAPI32\lineGetAgentStatusW"
    , "UInt", hLine   ; DWORD
    , "UInt", dwAddressID   ; DWORD
    , "Ptr", lpAgentStatus   ; LINEAGENTSTATUS* in/out
    , "Int")   ; return: INT
●lineGetAgentStatusW(hLine, dwAddressID, lpAgentStatus) = DLL("TAPI32.dll", "int lineGetAgentStatusW(dword, dword, void*)")
# 呼び出し: lineGetAgentStatusW(hLine, dwAddressID, lpAgentStatus)
# hLine : DWORD -> "dword"
# dwAddressID : DWORD -> "dword"
# lpAgentStatus : LINEAGENTSTATUS* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。