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

tapiRequestMakeCall

関数
指定した宛先への発信を要求する簡易TAPI関数。
DLLTAPI32.dll文字セットANSI (-A)呼出規約winapi

シグネチャ

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

INT tapiRequestMakeCall(
    LPCSTR lpszDestAddress,
    LPCSTR lpszAppName,
    LPCSTR lpszCalledParty,
    LPCSTR lpszComment
);

パラメーター

名前方向説明
lpszDestAddressLPCSTRin発信先のアドレス(電話番号)を示す文字列。
lpszAppNameLPCSTRin発信を要求するアプリケーション名を示す文字列。NULL可。
lpszCalledPartyLPCSTRin通話相手の名称を示す文字列。ログ表示用。NULL可。
lpszCommentLPCSTRin通話に付随するコメント文字列。NULL可。

戻り値の型: INT

各言語での呼び出し定義

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

INT tapiRequestMakeCall(
    LPCSTR lpszDestAddress,
    LPCSTR lpszAppName,
    LPCSTR lpszCalledParty,
    LPCSTR lpszComment
);
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int tapiRequestMakeCall(
    [MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string lpszAppName,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string lpszCalledParty,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string lpszComment   // LPCSTR
);
<DllImport("TAPI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function tapiRequestMakeCall(
    <MarshalAs(UnmanagedType.LPStr)> lpszDestAddress As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> lpszAppName As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> lpszCalledParty As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> lpszComment As String   ' LPCSTR
) As Integer
End Function
' lpszDestAddress : LPCSTR
' lpszAppName : LPCSTR
' lpszCalledParty : LPCSTR
' lpszComment : LPCSTR
Declare PtrSafe Function tapiRequestMakeCall Lib "tapi32" ( _
    ByVal lpszDestAddress As String, _
    ByVal lpszAppName As String, _
    ByVal lpszCalledParty As String, _
    ByVal lpszComment As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

tapiRequestMakeCall = ctypes.windll.tapi32.tapiRequestMakeCall
tapiRequestMakeCall.restype = ctypes.c_int
tapiRequestMakeCall.argtypes = [
    wintypes.LPCSTR,  # lpszDestAddress : LPCSTR
    wintypes.LPCSTR,  # lpszAppName : LPCSTR
    wintypes.LPCSTR,  # lpszCalledParty : LPCSTR
    wintypes.LPCSTR,  # lpszComment : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('TAPI32.dll')
tapiRequestMakeCall = Fiddle::Function.new(
  lib['tapiRequestMakeCall'],
  [
    Fiddle::TYPE_VOIDP,  # lpszDestAddress : LPCSTR
    Fiddle::TYPE_VOIDP,  # lpszAppName : LPCSTR
    Fiddle::TYPE_VOIDP,  # lpszCalledParty : LPCSTR
    Fiddle::TYPE_VOIDP,  # lpszComment : LPCSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "tapi32")]
extern "system" {
    fn tapiRequestMakeCall(
        lpszDestAddress: *const u8,  // LPCSTR
        lpszAppName: *const u8,  // LPCSTR
        lpszCalledParty: *const u8,  // LPCSTR
        lpszComment: *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 tapiRequestMakeCall([MarshalAs(UnmanagedType.LPStr)] string lpszDestAddress, [MarshalAs(UnmanagedType.LPStr)] string lpszAppName, [MarshalAs(UnmanagedType.LPStr)] string lpszCalledParty, [MarshalAs(UnmanagedType.LPStr)] string lpszComment);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_tapiRequestMakeCall' -Namespace Win32 -PassThru
# $api::tapiRequestMakeCall(lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)
#uselib "TAPI32.dll"
#func global tapiRequestMakeCall "tapiRequestMakeCall" sptr, sptr, sptr, sptr
; tapiRequestMakeCall lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment   ; 戻り値は stat
; lpszDestAddress : LPCSTR -> "sptr"
; lpszAppName : LPCSTR -> "sptr"
; lpszCalledParty : LPCSTR -> "sptr"
; lpszComment : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "TAPI32.dll"
#cfunc global tapiRequestMakeCall "tapiRequestMakeCall" str, str, str, str
; res = tapiRequestMakeCall(lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)
; lpszDestAddress : LPCSTR -> "str"
; lpszAppName : LPCSTR -> "str"
; lpszCalledParty : LPCSTR -> "str"
; lpszComment : LPCSTR -> "str"
; INT tapiRequestMakeCall(LPCSTR lpszDestAddress, LPCSTR lpszAppName, LPCSTR lpszCalledParty, LPCSTR lpszComment)
#uselib "TAPI32.dll"
#cfunc global tapiRequestMakeCall "tapiRequestMakeCall" str, str, str, str
; res = tapiRequestMakeCall(lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)
; lpszDestAddress : LPCSTR -> "str"
; lpszAppName : LPCSTR -> "str"
; lpszCalledParty : LPCSTR -> "str"
; lpszComment : LPCSTR -> "str"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proctapiRequestMakeCall = tapi32.NewProc("tapiRequestMakeCall")
)

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