ホーム › Devices.Tapi › tapiRequestMediaCallA
tapiRequestMediaCallA
関数メディア通話を要求する関数のANSI版。
シグネチャ
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT tapiRequestMediaCallA(
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 |
| lpszDeviceClass | LPCSTR | in |
| lpDeviceID | LPCSTR | in |
| dwSize | DWORD | in |
| dwSecure | DWORD | in |
| lpszDestAddress | LPCSTR | in |
| lpszAppName | LPCSTR | in |
| lpszCalledParty | LPCSTR | in |
| lpszComment | LPCSTR | in |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll (ANSI / -A)
#include <windows.h>
INT tapiRequestMediaCallA(
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 tapiRequestMediaCallA(
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 tapiRequestMediaCallA(
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 tapiRequestMediaCallA 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
tapiRequestMediaCallA = ctypes.windll.tapi32.tapiRequestMediaCallA
tapiRequestMediaCallA.restype = ctypes.c_int
tapiRequestMediaCallA.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')
tapiRequestMediaCallA = Fiddle::Function.new(
lib['tapiRequestMediaCallA'],
[
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 tapiRequestMediaCallA(
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 tapiRequestMediaCallA(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_tapiRequestMediaCallA' -Namespace Win32 -PassThru
# $api::tapiRequestMediaCallA(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)#uselib "TAPI32.dll"
#func global tapiRequestMediaCallA "tapiRequestMediaCallA" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; tapiRequestMediaCallA 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 tapiRequestMediaCallA "tapiRequestMediaCallA" sptr, sptr, str, str, int, int, str, str, str, str
; res = tapiRequestMediaCallA(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 tapiRequestMediaCallA(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 tapiRequestMediaCallA "tapiRequestMediaCallA" intptr, intptr, str, str, int, int, str, str, str, str
; res = tapiRequestMediaCallA(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")
proctapiRequestMediaCallA = tapi32.NewProc("tapiRequestMediaCallA")
)
// hwnd (HWND), wRequestID (WPARAM), lpszDeviceClass (LPCSTR), lpDeviceID (LPCSTR), dwSize (DWORD), dwSecure (DWORD), lpszDestAddress (LPCSTR), lpszAppName (LPCSTR), lpszCalledParty (LPCSTR), lpszComment (LPCSTR)
r1, _, err := proctapiRequestMediaCallA.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 tapiRequestMediaCallA(
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 'tapiRequestMediaCallA';result := DllCall("TAPI32\tapiRequestMediaCallA"
, "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●tapiRequestMediaCallA(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment) = DLL("TAPI32.dll", "int tapiRequestMediaCallA(void*, int, char*, char*, dword, dword, char*, char*, char*, char*)")
# 呼び出し: tapiRequestMediaCallA(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)。