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

linePickupA

関数
他で保留・着信中の通話を取得して応答する(ANSI版)。
DLLTAPI32.dll文字セットANSI (-A)呼出規約winapi

シグネチャ

// TAPI32.dll  (ANSI / -A)
#include <windows.h>

INT linePickupA(
    DWORD hLine,
    DWORD dwAddressID,
    DWORD* lphCall,
    LPCSTR lpszDestAddress,
    LPCSTR lpszGroupID
);

パラメーター

名前方向
hLineDWORDin
dwAddressIDDWORDin
lphCallDWORD*inout
lpszDestAddressLPCSTRin
lpszGroupIDLPCSTRin

戻り値の型: INT

各言語での呼び出し定義

// TAPI32.dll  (ANSI / -A)
#include <windows.h>

INT linePickupA(
    DWORD hLine,
    DWORD dwAddressID,
    DWORD* lphCall,
    LPCSTR lpszDestAddress,
    LPCSTR lpszGroupID
);
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int linePickupA(
    uint hLine,   // DWORD
    uint dwAddressID,   // DWORD
    ref uint lphCall,   // DWORD* in/out
    [MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string lpszGroupID   // LPCSTR
);
<DllImport("TAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function linePickupA(
    hLine As UInteger,   ' DWORD
    dwAddressID As UInteger,   ' DWORD
    ByRef lphCall As UInteger,   ' DWORD* in/out
    <MarshalAs(UnmanagedType.LPStr)> lpszDestAddress As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> lpszGroupID As String   ' LPCSTR
) As Integer
End Function
' hLine : DWORD
' dwAddressID : DWORD
' lphCall : DWORD* in/out
' lpszDestAddress : LPCSTR
' lpszGroupID : LPCSTR
Declare PtrSafe Function linePickupA Lib "tapi32" ( _
    ByVal hLine As Long, _
    ByVal dwAddressID As Long, _
    ByRef lphCall As Long, _
    ByVal lpszDestAddress As String, _
    ByVal lpszGroupID As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

linePickupA = ctypes.windll.tapi32.linePickupA
linePickupA.restype = ctypes.c_int
linePickupA.argtypes = [
    wintypes.DWORD,  # hLine : DWORD
    wintypes.DWORD,  # dwAddressID : DWORD
    ctypes.POINTER(wintypes.DWORD),  # lphCall : DWORD* in/out
    wintypes.LPCSTR,  # lpszDestAddress : LPCSTR
    wintypes.LPCSTR,  # lpszGroupID : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('TAPI32.dll')
linePickupA = Fiddle::Function.new(
  lib['linePickupA'],
  [
    -Fiddle::TYPE_INT,  # hLine : DWORD
    -Fiddle::TYPE_INT,  # dwAddressID : DWORD
    Fiddle::TYPE_VOIDP,  # lphCall : DWORD* in/out
    Fiddle::TYPE_VOIDP,  # lpszDestAddress : LPCSTR
    Fiddle::TYPE_VOIDP,  # lpszGroupID : LPCSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "tapi32")]
extern "system" {
    fn linePickupA(
        hLine: u32,  // DWORD
        dwAddressID: u32,  // DWORD
        lphCall: *mut u32,  // DWORD* in/out
        lpszDestAddress: *const u8,  // LPCSTR
        lpszGroupID: *const u8  // LPCSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi)]
public static extern int linePickupA(uint hLine, uint dwAddressID, ref uint lphCall, [MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress, [MarshalAs(UnmanagedType.LPStr)] string lpszGroupID);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_linePickupA' -Namespace Win32 -PassThru
# $api::linePickupA(hLine, dwAddressID, lphCall, lpszDestAddress, lpszGroupID)
#uselib "TAPI32.dll"
#func global linePickupA "linePickupA" sptr, sptr, sptr, sptr, sptr
; linePickupA hLine, dwAddressID, varptr(lphCall), lpszDestAddress, lpszGroupID   ; 戻り値は stat
; hLine : DWORD -> "sptr"
; dwAddressID : DWORD -> "sptr"
; lphCall : DWORD* in/out -> "sptr"
; lpszDestAddress : LPCSTR -> "sptr"
; lpszGroupID : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "TAPI32.dll"
#cfunc global linePickupA "linePickupA" int, int, var, str, str
; res = linePickupA(hLine, dwAddressID, lphCall, lpszDestAddress, lpszGroupID)
; hLine : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; lphCall : DWORD* in/out -> "var"
; lpszDestAddress : LPCSTR -> "str"
; lpszGroupID : LPCSTR -> "str"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT linePickupA(DWORD hLine, DWORD dwAddressID, DWORD* lphCall, LPCSTR lpszDestAddress, LPCSTR lpszGroupID)
#uselib "TAPI32.dll"
#cfunc global linePickupA "linePickupA" int, int, var, str, str
; res = linePickupA(hLine, dwAddressID, lphCall, lpszDestAddress, lpszGroupID)
; hLine : DWORD -> "int"
; dwAddressID : DWORD -> "int"
; lphCall : DWORD* in/out -> "var"
; lpszDestAddress : LPCSTR -> "str"
; lpszGroupID : LPCSTR -> "str"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclinePickupA = tapi32.NewProc("linePickupA")
)

// hLine (DWORD), dwAddressID (DWORD), lphCall (DWORD* in/out), lpszDestAddress (LPCSTR), lpszGroupID (LPCSTR)
r1, _, err := proclinePickupA.Call(
	uintptr(hLine),
	uintptr(dwAddressID),
	uintptr(lphCall),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszDestAddress))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszGroupID))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function linePickupA(
  hLine: DWORD;   // DWORD
  dwAddressID: DWORD;   // DWORD
  lphCall: Pointer;   // DWORD* in/out
  lpszDestAddress: PAnsiChar;   // LPCSTR
  lpszGroupID: PAnsiChar   // LPCSTR
): Integer; stdcall;
  external 'TAPI32.dll' name 'linePickupA';
result := DllCall("TAPI32\linePickupA"
    , "UInt", hLine   ; DWORD
    , "UInt", dwAddressID   ; DWORD
    , "Ptr", lphCall   ; DWORD* in/out
    , "AStr", lpszDestAddress   ; LPCSTR
    , "AStr", lpszGroupID   ; LPCSTR
    , "Int")   ; return: INT
●linePickupA(hLine, dwAddressID, lphCall, lpszDestAddress, lpszGroupID) = DLL("TAPI32.dll", "int linePickupA(dword, dword, void*, char*, char*)")
# 呼び出し: linePickupA(hLine, dwAddressID, lphCall, lpszDestAddress, lpszGroupID)
# hLine : DWORD -> "dword"
# dwAddressID : DWORD -> "dword"
# lphCall : DWORD* in/out -> "void*"
# lpszDestAddress : LPCSTR -> "char*"
# lpszGroupID : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。