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

tapiRequestDrop

関数
現在の通話を切断するよう要求する。
DLLTAPI32.dll呼出規約winapi

シグネチャ

// TAPI32.dll
#include <windows.h>

INT tapiRequestDrop(
    HWND hwnd,
    WPARAM wRequestID
);

パラメーター

名前方向
hwndHWNDin
wRequestIDWPARAMin

戻り値の型: INT

各言語での呼び出し定義

// TAPI32.dll
#include <windows.h>

INT tapiRequestDrop(
    HWND hwnd,
    WPARAM wRequestID
);
[DllImport("TAPI32.dll", ExactSpelling = true)]
static extern int tapiRequestDrop(
    IntPtr hwnd,   // HWND
    UIntPtr wRequestID   // WPARAM
);
<DllImport("TAPI32.dll", ExactSpelling:=True)>
Public Shared Function tapiRequestDrop(
    hwnd As IntPtr,   ' HWND
    wRequestID As UIntPtr   ' WPARAM
) As Integer
End Function
' hwnd : HWND
' wRequestID : WPARAM
Declare PtrSafe Function tapiRequestDrop Lib "tapi32" ( _
    ByVal hwnd As LongPtr, _
    ByVal wRequestID As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

tapiRequestDrop = ctypes.windll.tapi32.tapiRequestDrop
tapiRequestDrop.restype = ctypes.c_int
tapiRequestDrop.argtypes = [
    wintypes.HANDLE,  # hwnd : HWND
    ctypes.c_size_t,  # wRequestID : WPARAM
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('TAPI32.dll')
tapiRequestDrop = Fiddle::Function.new(
  lib['tapiRequestDrop'],
  [
    Fiddle::TYPE_VOIDP,  # hwnd : HWND
    Fiddle::TYPE_UINTPTR_T,  # wRequestID : WPARAM
  ],
  Fiddle::TYPE_INT)
#[link(name = "tapi32")]
extern "system" {
    fn tapiRequestDrop(
        hwnd: *mut core::ffi::c_void,  // HWND
        wRequestID: usize  // WPARAM
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("TAPI32.dll")]
public static extern int tapiRequestDrop(IntPtr hwnd, UIntPtr wRequestID);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_tapiRequestDrop' -Namespace Win32 -PassThru
# $api::tapiRequestDrop(hwnd, wRequestID)
#uselib "TAPI32.dll"
#func global tapiRequestDrop "tapiRequestDrop" sptr, sptr
; tapiRequestDrop hwnd, wRequestID   ; 戻り値は stat
; hwnd : HWND -> "sptr"
; wRequestID : WPARAM -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "TAPI32.dll"
#cfunc global tapiRequestDrop "tapiRequestDrop" sptr, sptr
; res = tapiRequestDrop(hwnd, wRequestID)
; hwnd : HWND -> "sptr"
; wRequestID : WPARAM -> "sptr"
; INT tapiRequestDrop(HWND hwnd, WPARAM wRequestID)
#uselib "TAPI32.dll"
#cfunc global tapiRequestDrop "tapiRequestDrop" intptr, intptr
; res = tapiRequestDrop(hwnd, wRequestID)
; hwnd : HWND -> "intptr"
; wRequestID : WPARAM -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proctapiRequestDrop = tapi32.NewProc("tapiRequestDrop")
)

// hwnd (HWND), wRequestID (WPARAM)
r1, _, err := proctapiRequestDrop.Call(
	uintptr(hwnd),
	uintptr(wRequestID),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function tapiRequestDrop(
  hwnd: THandle;   // HWND
  wRequestID: NativeUInt   // WPARAM
): Integer; stdcall;
  external 'TAPI32.dll' name 'tapiRequestDrop';
result := DllCall("TAPI32\tapiRequestDrop"
    , "Ptr", hwnd   ; HWND
    , "UPtr", wRequestID   ; WPARAM
    , "Int")   ; return: INT
●tapiRequestDrop(hwnd, wRequestID) = DLL("TAPI32.dll", "int tapiRequestDrop(void*, int)")
# 呼び出し: tapiRequestDrop(hwnd, wRequestID)
# hwnd : HWND -> "void*"
# wRequestID : WPARAM -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。