ホーム › Devices.Tapi › tapiRequestMediaCallW
tapiRequestMediaCallW
関数メディア通話を要求する関数のUnicode版。
シグネチャ
// TAPI32.dll (Unicode / -W)
#include <windows.h>
INT tapiRequestMediaCallW(
HWND hwnd,
WPARAM wRequestID,
LPCWSTR lpszDeviceClass,
LPCWSTR lpDeviceID,
DWORD dwSize,
DWORD dwSecure,
LPCWSTR lpszDestAddress,
LPCWSTR lpszAppName,
LPCWSTR lpszCalledParty,
LPCWSTR lpszComment
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hwnd | HWND | in |
| wRequestID | WPARAM | in |
| lpszDeviceClass | LPCWSTR | in |
| lpDeviceID | LPCWSTR | in |
| dwSize | DWORD | in |
| dwSecure | DWORD | in |
| lpszDestAddress | LPCWSTR | in |
| lpszAppName | LPCWSTR | in |
| lpszCalledParty | LPCWSTR | in |
| lpszComment | LPCWSTR | in |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll (Unicode / -W)
#include <windows.h>
INT tapiRequestMediaCallW(
HWND hwnd,
WPARAM wRequestID,
LPCWSTR lpszDeviceClass,
LPCWSTR lpDeviceID,
DWORD dwSize,
DWORD dwSecure,
LPCWSTR lpszDestAddress,
LPCWSTR lpszAppName,
LPCWSTR lpszCalledParty,
LPCWSTR lpszComment
);[DllImport("TAPI32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int tapiRequestMediaCallW(
IntPtr hwnd, // HWND
UIntPtr wRequestID, // WPARAM
[MarshalAs(UnmanagedType.LPWStr)] string lpszDeviceClass, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string lpDeviceID, // LPCWSTR
uint dwSize, // DWORD
uint dwSecure, // DWORD
[MarshalAs(UnmanagedType.LPWStr)] string lpszDestAddress, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string lpszAppName, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string lpszCalledParty, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string lpszComment // LPCWSTR
);<DllImport("TAPI32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function tapiRequestMediaCallW(
hwnd As IntPtr, ' HWND
wRequestID As UIntPtr, ' WPARAM
<MarshalAs(UnmanagedType.LPWStr)> lpszDeviceClass As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> lpDeviceID As String, ' LPCWSTR
dwSize As UInteger, ' DWORD
dwSecure As UInteger, ' DWORD
<MarshalAs(UnmanagedType.LPWStr)> lpszDestAddress As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> lpszAppName As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> lpszCalledParty As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> lpszComment As String ' LPCWSTR
) As Integer
End Function' hwnd : HWND
' wRequestID : WPARAM
' lpszDeviceClass : LPCWSTR
' lpDeviceID : LPCWSTR
' dwSize : DWORD
' dwSecure : DWORD
' lpszDestAddress : LPCWSTR
' lpszAppName : LPCWSTR
' lpszCalledParty : LPCWSTR
' lpszComment : LPCWSTR
Declare PtrSafe Function tapiRequestMediaCallW Lib "tapi32" ( _
ByVal hwnd As LongPtr, _
ByVal wRequestID As LongPtr, _
ByVal lpszDeviceClass As LongPtr, _
ByVal lpDeviceID As LongPtr, _
ByVal dwSize As Long, _
ByVal dwSecure As Long, _
ByVal lpszDestAddress As LongPtr, _
ByVal lpszAppName As LongPtr, _
ByVal lpszCalledParty As LongPtr, _
ByVal lpszComment 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
tapiRequestMediaCallW = ctypes.windll.tapi32.tapiRequestMediaCallW
tapiRequestMediaCallW.restype = ctypes.c_int
tapiRequestMediaCallW.argtypes = [
wintypes.HANDLE, # hwnd : HWND
ctypes.c_size_t, # wRequestID : WPARAM
wintypes.LPCWSTR, # lpszDeviceClass : LPCWSTR
wintypes.LPCWSTR, # lpDeviceID : LPCWSTR
wintypes.DWORD, # dwSize : DWORD
wintypes.DWORD, # dwSecure : DWORD
wintypes.LPCWSTR, # lpszDestAddress : LPCWSTR
wintypes.LPCWSTR, # lpszAppName : LPCWSTR
wintypes.LPCWSTR, # lpszCalledParty : LPCWSTR
wintypes.LPCWSTR, # lpszComment : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
tapiRequestMediaCallW = Fiddle::Function.new(
lib['tapiRequestMediaCallW'],
[
Fiddle::TYPE_VOIDP, # hwnd : HWND
Fiddle::TYPE_UINTPTR_T, # wRequestID : WPARAM
Fiddle::TYPE_VOIDP, # lpszDeviceClass : LPCWSTR
Fiddle::TYPE_VOIDP, # lpDeviceID : LPCWSTR
-Fiddle::TYPE_INT, # dwSize : DWORD
-Fiddle::TYPE_INT, # dwSecure : DWORD
Fiddle::TYPE_VOIDP, # lpszDestAddress : LPCWSTR
Fiddle::TYPE_VOIDP, # lpszAppName : LPCWSTR
Fiddle::TYPE_VOIDP, # lpszCalledParty : LPCWSTR
Fiddle::TYPE_VOIDP, # lpszComment : LPCWSTR
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "tapi32")]
extern "system" {
fn tapiRequestMediaCallW(
hwnd: *mut core::ffi::c_void, // HWND
wRequestID: usize, // WPARAM
lpszDeviceClass: *const u16, // LPCWSTR
lpDeviceID: *const u16, // LPCWSTR
dwSize: u32, // DWORD
dwSecure: u32, // DWORD
lpszDestAddress: *const u16, // LPCWSTR
lpszAppName: *const u16, // LPCWSTR
lpszCalledParty: *const u16, // LPCWSTR
lpszComment: *const u16 // LPCWSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll", CharSet = CharSet.Unicode)]
public static extern int tapiRequestMediaCallW(IntPtr hwnd, UIntPtr wRequestID, [MarshalAs(UnmanagedType.LPWStr)] string lpszDeviceClass, [MarshalAs(UnmanagedType.LPWStr)] string lpDeviceID, uint dwSize, uint dwSecure, [MarshalAs(UnmanagedType.LPWStr)] string lpszDestAddress, [MarshalAs(UnmanagedType.LPWStr)] string lpszAppName, [MarshalAs(UnmanagedType.LPWStr)] string lpszCalledParty, [MarshalAs(UnmanagedType.LPWStr)] string lpszComment);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_tapiRequestMediaCallW' -Namespace Win32 -PassThru
# $api::tapiRequestMediaCallW(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)#uselib "TAPI32.dll"
#func global tapiRequestMediaCallW "tapiRequestMediaCallW" wptr, wptr, wptr, wptr, wptr, wptr, wptr, wptr, wptr, wptr
; tapiRequestMediaCallW hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment ; 戻り値は stat
; hwnd : HWND -> "wptr"
; wRequestID : WPARAM -> "wptr"
; lpszDeviceClass : LPCWSTR -> "wptr"
; lpDeviceID : LPCWSTR -> "wptr"
; dwSize : DWORD -> "wptr"
; dwSecure : DWORD -> "wptr"
; lpszDestAddress : LPCWSTR -> "wptr"
; lpszAppName : LPCWSTR -> "wptr"
; lpszCalledParty : LPCWSTR -> "wptr"
; lpszComment : LPCWSTR -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "TAPI32.dll"
#cfunc global tapiRequestMediaCallW "tapiRequestMediaCallW" sptr, sptr, wstr, wstr, int, int, wstr, wstr, wstr, wstr
; res = tapiRequestMediaCallW(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)
; hwnd : HWND -> "sptr"
; wRequestID : WPARAM -> "sptr"
; lpszDeviceClass : LPCWSTR -> "wstr"
; lpDeviceID : LPCWSTR -> "wstr"
; dwSize : DWORD -> "int"
; dwSecure : DWORD -> "int"
; lpszDestAddress : LPCWSTR -> "wstr"
; lpszAppName : LPCWSTR -> "wstr"
; lpszCalledParty : LPCWSTR -> "wstr"
; lpszComment : LPCWSTR -> "wstr"; INT tapiRequestMediaCallW(HWND hwnd, WPARAM wRequestID, LPCWSTR lpszDeviceClass, LPCWSTR lpDeviceID, DWORD dwSize, DWORD dwSecure, LPCWSTR lpszDestAddress, LPCWSTR lpszAppName, LPCWSTR lpszCalledParty, LPCWSTR lpszComment)
#uselib "TAPI32.dll"
#cfunc global tapiRequestMediaCallW "tapiRequestMediaCallW" intptr, intptr, wstr, wstr, int, int, wstr, wstr, wstr, wstr
; res = tapiRequestMediaCallW(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)
; hwnd : HWND -> "intptr"
; wRequestID : WPARAM -> "intptr"
; lpszDeviceClass : LPCWSTR -> "wstr"
; lpDeviceID : LPCWSTR -> "wstr"
; dwSize : DWORD -> "int"
; dwSecure : DWORD -> "int"
; lpszDestAddress : LPCWSTR -> "wstr"
; lpszAppName : LPCWSTR -> "wstr"
; lpszCalledParty : LPCWSTR -> "wstr"
; lpszComment : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
proctapiRequestMediaCallW = tapi32.NewProc("tapiRequestMediaCallW")
)
// hwnd (HWND), wRequestID (WPARAM), lpszDeviceClass (LPCWSTR), lpDeviceID (LPCWSTR), dwSize (DWORD), dwSecure (DWORD), lpszDestAddress (LPCWSTR), lpszAppName (LPCWSTR), lpszCalledParty (LPCWSTR), lpszComment (LPCWSTR)
r1, _, err := proctapiRequestMediaCallW.Call(
uintptr(hwnd),
uintptr(wRequestID),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszDeviceClass))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpDeviceID))),
uintptr(dwSize),
uintptr(dwSecure),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszDestAddress))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszAppName))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszCalledParty))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszComment))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction tapiRequestMediaCallW(
hwnd: THandle; // HWND
wRequestID: NativeUInt; // WPARAM
lpszDeviceClass: PWideChar; // LPCWSTR
lpDeviceID: PWideChar; // LPCWSTR
dwSize: DWORD; // DWORD
dwSecure: DWORD; // DWORD
lpszDestAddress: PWideChar; // LPCWSTR
lpszAppName: PWideChar; // LPCWSTR
lpszCalledParty: PWideChar; // LPCWSTR
lpszComment: PWideChar // LPCWSTR
): Integer; stdcall;
external 'TAPI32.dll' name 'tapiRequestMediaCallW';result := DllCall("TAPI32\tapiRequestMediaCallW"
, "Ptr", hwnd ; HWND
, "UPtr", wRequestID ; WPARAM
, "WStr", lpszDeviceClass ; LPCWSTR
, "WStr", lpDeviceID ; LPCWSTR
, "UInt", dwSize ; DWORD
, "UInt", dwSecure ; DWORD
, "WStr", lpszDestAddress ; LPCWSTR
, "WStr", lpszAppName ; LPCWSTR
, "WStr", lpszCalledParty ; LPCWSTR
, "WStr", lpszComment ; LPCWSTR
, "Int") ; return: INT●tapiRequestMediaCallW(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment) = DLL("TAPI32.dll", "int tapiRequestMediaCallW(void*, int, char*, char*, dword, dword, char*, char*, char*, char*)")
# 呼び出し: tapiRequestMediaCallW(hwnd, wRequestID, lpszDeviceClass, lpDeviceID, dwSize, dwSecure, lpszDestAddress, lpszAppName, lpszCalledParty, lpszComment)
# hwnd : HWND -> "void*"
# wRequestID : WPARAM -> "int"
# lpszDeviceClass : LPCWSTR -> "char*"
# lpDeviceID : LPCWSTR -> "char*"
# dwSize : DWORD -> "dword"
# dwSecure : DWORD -> "dword"
# lpszDestAddress : LPCWSTR -> "char*"
# lpszAppName : LPCWSTR -> "char*"
# lpszCalledParty : LPCWSTR -> "char*"
# lpszComment : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。