ホーム › Devices.Tapi › tapiRequestMediaCall
tapiRequestMediaCall
関数メディア種別を指定した着信通話の処理を要求する。
シグネチャ
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT tapiRequestMediaCall(
HWND hwnd,
WPARAM wRequestID,
LPCSTR lpszDeviceClass,
LPCSTR lpDeviceID,
DWORD dwSize,
DWORD dwSecure,
LPCSTR lpszDestAddress,
LPCSTR lpszAppName,
LPCSTR lpszCalledParty,
LPCSTR lpszComment
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hwnd | HWND | in | メディア通話要求を出すアプリケーションのウィンドウハンドル。 |
| wRequestID | WPARAM | in | この要求を識別するための要求ID(WPARAM)。 |
| lpszDeviceClass | LPCSTR | in | 使用するメディアデバイスクラスを示す文字列。 |
| lpDeviceID | LPCSTR | in | デバイスIDデータへのポインタ。書式はデバイスクラス依存。 |
| dwSize | DWORD | in | lpDeviceIDが指すデータのバイト数。 |
| dwSecure | DWORD | in | 通話のセキュア(暗号化)有無を示すフラグ。0で非セキュア。 |
| lpszDestAddress | LPCSTR | in | 発信先のアドレス(電話番号)を示す文字列。 |
| lpszAppName | LPCSTR | in | 発信を要求するアプリケーション名を示す文字列。NULL可。 |
| lpszCalledParty | LPCSTR | in | 通話相手の名称を示す文字列。ログ表示用。NULL可。 |
| lpszComment | LPCSTR | in | 通話に付随するコメント文字列。NULL可。 |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT tapiRequestMediaCall(
HWND hwnd,
WPARAM wRequestID,
LPCSTR lpszDeviceClass,
LPCSTR lpDeviceID,
DWORD dwSize,
DWORD dwSecure,
LPCSTR lpszDestAddress,
LPCSTR lpszAppName,
LPCSTR lpszCalledParty,
LPCSTR lpszComment
);[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int tapiRequestMediaCall(
IntPtr hwnd, // HWND
UIntPtr wRequestID, // WPARAM
[MarshalAs(UnmanagedType.LPStr)] string lpszDeviceClass, // LPCSTR
[MarshalAs(UnmanagedType.LPStr)] string lpDeviceID, // LPCSTR
uint dwSize, // DWORD
uint dwSecure, // DWORD
[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 tapiRequestMediaCall(
hwnd As IntPtr, ' HWND
wRequestID As UIntPtr, ' WPARAM
<MarshalAs(UnmanagedType.LPStr)> lpszDeviceClass As String, ' LPCSTR
<MarshalAs(UnmanagedType.LPStr)> lpDeviceID As String, ' LPCSTR
dwSize As UInteger, ' DWORD
dwSecure As UInteger, ' DWORD
<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' hwnd : HWND
' wRequestID : WPARAM
' lpszDeviceClass : LPCSTR
' lpDeviceID : LPCSTR
' dwSize : DWORD
' dwSecure : DWORD
' lpszDestAddress : LPCSTR
' lpszAppName : LPCSTR
' lpszCalledParty : LPCSTR
' lpszComment : LPCSTR
Declare PtrSafe Function tapiRequestMediaCall Lib "tapi32" ( _
ByVal hwnd As LongPtr, _
ByVal wRequestID As LongPtr, _
ByVal lpszDeviceClass As String, _
ByVal lpDeviceID As String, _
ByVal dwSize As Long, _
ByVal dwSecure As Long, _
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
tapiRequestMediaCall = ctypes.windll.tapi32.tapiRequestMediaCall
tapiRequestMediaCall.restype = ctypes.c_int
tapiRequestMediaCall.argtypes = [
wintypes.HANDLE, # hwnd : HWND
ctypes.c_size_t, # wRequestID : WPARAM
wintypes.LPCSTR, # lpszDeviceClass : LPCSTR
wintypes.LPCSTR, # lpDeviceID : LPCSTR
wintypes.DWORD, # dwSize : DWORD
wintypes.DWORD, # dwSecure : DWORD
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')
tapiRequestMediaCall = Fiddle::Function.new(
lib['tapiRequestMediaCall'],
[
Fiddle::TYPE_VOIDP, # hwnd : HWND
Fiddle::TYPE_UINTPTR_T, # wRequestID : WPARAM
Fiddle::TYPE_VOIDP, # lpszDeviceClass : LPCSTR
Fiddle::TYPE_VOIDP, # lpDeviceID : LPCSTR
-Fiddle::TYPE_INT, # dwSize : DWORD
-Fiddle::TYPE_INT, # dwSecure : DWORD
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 tapiRequestMediaCall(
hwnd: *mut core::ffi::c_void, // HWND
wRequestID: usize, // WPARAM
lpszDeviceClass: *const u8, // LPCSTR
lpDeviceID: *const u8, // LPCSTR
dwSize: u32, // DWORD
dwSecure: u32, // DWORD
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 tapiRequestMediaCall(IntPtr hwnd, UIntPtr wRequestID, [MarshalAs(UnmanagedType.LPStr)] string lpszDeviceClass, [MarshalAs(UnmanagedType.LPStr)] string lpDeviceID, uint dwSize, uint dwSecure, [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_tapiRequestMediaCall' -Namespace Win32 -PassThru
# $api::tapiRequestMediaCall(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)#uselib "TAPI32.dll"
#func global tapiRequestMediaCall "tapiRequestMediaCall" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; tapiRequestMediaCall hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment ; 戻り値は stat
; hwnd : HWND -> "sptr"
; wRequestID : WPARAM -> "sptr"
; lpszDeviceClass : LPCSTR -> "sptr"
; lpDeviceID : LPCSTR -> "sptr"
; dwSize : DWORD -> "sptr"
; dwSecure : DWORD -> "sptr"
; lpszDestAddress : LPCSTR -> "sptr"
; lpszAppName : LPCSTR -> "sptr"
; lpszCalledParty : LPCSTR -> "sptr"
; lpszComment : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "TAPI32.dll"
#cfunc global tapiRequestMediaCall "tapiRequestMediaCall" sptr, sptr, str, str, int, int, str, str, str, str
; res = tapiRequestMediaCall(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)
; hwnd : HWND -> "sptr"
; wRequestID : WPARAM -> "sptr"
; lpszDeviceClass : LPCSTR -> "str"
; lpDeviceID : LPCSTR -> "str"
; dwSize : DWORD -> "int"
; dwSecure : DWORD -> "int"
; lpszDestAddress : LPCSTR -> "str"
; lpszAppName : LPCSTR -> "str"
; lpszCalledParty : LPCSTR -> "str"
; lpszComment : LPCSTR -> "str"; INT tapiRequestMediaCall(HWND hwnd, WPARAM wRequestID, LPCSTR lpszDeviceClass, LPCSTR lpDeviceID, DWORD dwSize, DWORD dwSecure, LPCSTR lpszDestAddress, LPCSTR lpszAppName, LPCSTR lpszCalledParty, LPCSTR lpszComment)
#uselib "TAPI32.dll"
#cfunc global tapiRequestMediaCall "tapiRequestMediaCall" intptr, intptr, str, str, int, int, str, str, str, str
; res = tapiRequestMediaCall(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)
; hwnd : HWND -> "intptr"
; wRequestID : WPARAM -> "intptr"
; lpszDeviceClass : LPCSTR -> "str"
; lpDeviceID : LPCSTR -> "str"
; dwSize : DWORD -> "int"
; dwSecure : DWORD -> "int"
; 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")
proctapiRequestMediaCall = tapi32.NewProc("tapiRequestMediaCall")
)
// hwnd (HWND), wRequestID (WPARAM), lpszDeviceClass (LPCSTR), lpDeviceID (LPCSTR), dwSize (DWORD), dwSecure (DWORD), lpszDestAddress (LPCSTR), lpszAppName (LPCSTR), lpszCalledParty (LPCSTR), lpszComment (LPCSTR)
r1, _, err := proctapiRequestMediaCall.Call(
uintptr(hwnd),
uintptr(wRequestID),
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszDeviceClass))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpDeviceID))),
uintptr(dwSize),
uintptr(dwSecure),
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 // INTfunction tapiRequestMediaCall(
hwnd: THandle; // HWND
wRequestID: NativeUInt; // WPARAM
lpszDeviceClass: PAnsiChar; // LPCSTR
lpDeviceID: PAnsiChar; // LPCSTR
dwSize: DWORD; // DWORD
dwSecure: DWORD; // DWORD
lpszDestAddress: PAnsiChar; // LPCSTR
lpszAppName: PAnsiChar; // LPCSTR
lpszCalledParty: PAnsiChar; // LPCSTR
lpszComment: PAnsiChar // LPCSTR
): Integer; stdcall;
external 'TAPI32.dll' name 'tapiRequestMediaCall';result := DllCall("TAPI32\tapiRequestMediaCall"
, "Ptr", hwnd ; HWND
, "UPtr", wRequestID ; WPARAM
, "AStr", lpszDeviceClass ; LPCSTR
, "AStr", lpDeviceID ; LPCSTR
, "UInt", dwSize ; DWORD
, "UInt", dwSecure ; DWORD
, "AStr", lpszDestAddress ; LPCSTR
, "AStr", lpszAppName ; LPCSTR
, "AStr", lpszCalledParty ; LPCSTR
, "AStr", lpszComment ; LPCSTR
, "Int") ; return: INT●tapiRequestMediaCall(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment) = DLL("TAPI32.dll", "int tapiRequestMediaCall(void*, int, char*, char*, dword, dword, char*, char*, char*, char*)")
# 呼び出し: tapiRequestMediaCall(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)
# hwnd : HWND -> "void*"
# wRequestID : WPARAM -> "int"
# lpszDeviceClass : LPCSTR -> "char*"
# lpDeviceID : LPCSTR -> "char*"
# dwSize : DWORD -> "dword"
# dwSecure : DWORD -> "dword"
# lpszDestAddress : LPCSTR -> "char*"
# lpszAppName : LPCSTR -> "char*"
# lpszCalledParty : LPCSTR -> "char*"
# lpszComment : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。