ホーム › Devices.Tapi › lineRedirect
lineRedirect
関数着信中の通話を指定アドレスへリダイレクトする。
シグネチャ
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT lineRedirect(
DWORD hCall,
LPCSTR lpszDestAddress,
DWORD dwCountryCode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hCall | DWORD | in |
| lpszDestAddress | LPCSTR | in |
| dwCountryCode | DWORD | in |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT lineRedirect(
DWORD hCall,
LPCSTR lpszDestAddress,
DWORD dwCountryCode
);[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int lineRedirect(
uint hCall, // DWORD
[MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress, // LPCSTR
uint dwCountryCode // DWORD
);<DllImport("TAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function lineRedirect(
hCall As UInteger, ' DWORD
<MarshalAs(UnmanagedType.LPStr)> lpszDestAddress As String, ' LPCSTR
dwCountryCode As UInteger ' DWORD
) As Integer
End Function' hCall : DWORD
' lpszDestAddress : LPCSTR
' dwCountryCode : DWORD
Declare PtrSafe Function lineRedirect Lib "tapi32" ( _
ByVal hCall As Long, _
ByVal lpszDestAddress As String, _
ByVal dwCountryCode As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
lineRedirect = ctypes.windll.tapi32.lineRedirect
lineRedirect.restype = ctypes.c_int
lineRedirect.argtypes = [
wintypes.DWORD, # hCall : DWORD
wintypes.LPCSTR, # lpszDestAddress : LPCSTR
wintypes.DWORD, # dwCountryCode : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
lineRedirect = Fiddle::Function.new(
lib['lineRedirect'],
[
-Fiddle::TYPE_INT, # hCall : DWORD
Fiddle::TYPE_VOIDP, # lpszDestAddress : LPCSTR
-Fiddle::TYPE_INT, # dwCountryCode : DWORD
],
Fiddle::TYPE_INT)#[link(name = "tapi32")]
extern "system" {
fn lineRedirect(
hCall: u32, // DWORD
lpszDestAddress: *const u8, // LPCSTR
dwCountryCode: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi)]
public static extern int lineRedirect(uint hCall, [MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress, uint dwCountryCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineRedirect' -Namespace Win32 -PassThru
# $api::lineRedirect(hCall, lpszDestAddress, dwCountryCode)#uselib "TAPI32.dll"
#func global lineRedirect "lineRedirect" sptr, sptr, sptr
; lineRedirect hCall, lpszDestAddress, dwCountryCode ; 戻り値は stat
; hCall : DWORD -> "sptr"
; lpszDestAddress : LPCSTR -> "sptr"
; dwCountryCode : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "TAPI32.dll"
#cfunc global lineRedirect "lineRedirect" int, str, int
; res = lineRedirect(hCall, lpszDestAddress, dwCountryCode)
; hCall : DWORD -> "int"
; lpszDestAddress : LPCSTR -> "str"
; dwCountryCode : DWORD -> "int"; INT lineRedirect(DWORD hCall, LPCSTR lpszDestAddress, DWORD dwCountryCode)
#uselib "TAPI32.dll"
#cfunc global lineRedirect "lineRedirect" int, str, int
; res = lineRedirect(hCall, lpszDestAddress, dwCountryCode)
; hCall : DWORD -> "int"
; lpszDestAddress : LPCSTR -> "str"
; dwCountryCode : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
proclineRedirect = tapi32.NewProc("lineRedirect")
)
// hCall (DWORD), lpszDestAddress (LPCSTR), dwCountryCode (DWORD)
r1, _, err := proclineRedirect.Call(
uintptr(hCall),
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszDestAddress))),
uintptr(dwCountryCode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction lineRedirect(
hCall: DWORD; // DWORD
lpszDestAddress: PAnsiChar; // LPCSTR
dwCountryCode: DWORD // DWORD
): Integer; stdcall;
external 'TAPI32.dll' name 'lineRedirect';result := DllCall("TAPI32\lineRedirect"
, "UInt", hCall ; DWORD
, "AStr", lpszDestAddress ; LPCSTR
, "UInt", dwCountryCode ; DWORD
, "Int") ; return: INT●lineRedirect(hCall, lpszDestAddress, dwCountryCode) = DLL("TAPI32.dll", "int lineRedirect(dword, char*, dword)")
# 呼び出し: lineRedirect(hCall, lpszDestAddress, dwCountryCode)
# hCall : DWORD -> "dword"
# lpszDestAddress : LPCSTR -> "char*"
# dwCountryCode : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。