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

lineMakeCallW

関数
指定アドレスへ発信して新しい通話を開始する(Unicode版)。
DLLTAPI32.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

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

INT lineMakeCallW(
    DWORD hLine,
    DWORD* lphCall,
    LPCWSTR lpszDestAddress,
    DWORD dwCountryCode,
    const LINECALLPARAMS* lpCallParams
);

パラメーター

名前方向
hLineDWORDin
lphCallDWORD*inout
lpszDestAddressLPCWSTRin
dwCountryCodeDWORDin
lpCallParamsLINECALLPARAMS*in

戻り値の型: INT

各言語での呼び出し定義

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

INT lineMakeCallW(
    DWORD hLine,
    DWORD* lphCall,
    LPCWSTR lpszDestAddress,
    DWORD dwCountryCode,
    const LINECALLPARAMS* lpCallParams
);
[DllImport("TAPI32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int lineMakeCallW(
    uint hLine,   // DWORD
    ref uint lphCall,   // DWORD* in/out
    [MarshalAs(UnmanagedType.LPWStr)] string lpszDestAddress,   // LPCWSTR
    uint dwCountryCode,   // DWORD
    IntPtr lpCallParams   // LINECALLPARAMS*
);
<DllImport("TAPI32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function lineMakeCallW(
    hLine As UInteger,   ' DWORD
    ByRef lphCall As UInteger,   ' DWORD* in/out
    <MarshalAs(UnmanagedType.LPWStr)> lpszDestAddress As String,   ' LPCWSTR
    dwCountryCode As UInteger,   ' DWORD
    lpCallParams As IntPtr   ' LINECALLPARAMS*
) As Integer
End Function
' hLine : DWORD
' lphCall : DWORD* in/out
' lpszDestAddress : LPCWSTR
' dwCountryCode : DWORD
' lpCallParams : LINECALLPARAMS*
Declare PtrSafe Function lineMakeCallW Lib "tapi32" ( _
    ByVal hLine As Long, _
    ByRef lphCall As Long, _
    ByVal lpszDestAddress As LongPtr, _
    ByVal dwCountryCode As Long, _
    ByVal lpCallParams 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

lineMakeCallW = ctypes.windll.tapi32.lineMakeCallW
lineMakeCallW.restype = ctypes.c_int
lineMakeCallW.argtypes = [
    wintypes.DWORD,  # hLine : DWORD
    ctypes.POINTER(wintypes.DWORD),  # lphCall : DWORD* in/out
    wintypes.LPCWSTR,  # lpszDestAddress : LPCWSTR
    wintypes.DWORD,  # dwCountryCode : DWORD
    ctypes.c_void_p,  # lpCallParams : LINECALLPARAMS*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineMakeCallW = tapi32.NewProc("lineMakeCallW")
)

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