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

tapiRequestDrop

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

シグネチャ

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

INT tapiRequestDrop(
    HWND hwnd,
    WPARAM wRequestID
);

パラメーター

名前方向説明
hwndHWNDin通話切断要求を出すアプリケーションのウィンドウハンドル。
wRequestIDWPARAMin切断対象の通話を識別するための要求ID(WPARAM)。

戻り値の型: 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)。
const std = @import("std");

extern "tapi32" fn tapiRequestDrop(
    hwnd: ?*anyopaque, // HWND
    wRequestID: usize // WPARAM
) callconv(std.os.windows.WINAPI) i32;
proc tapiRequestDrop(
    hwnd: pointer,  # HWND
    wRequestID: uint  # WPARAM
): int32 {.importc: "tapiRequestDrop", stdcall, dynlib: "TAPI32.dll".}
pragma(lib, "tapi32");
extern(Windows)
int tapiRequestDrop(
    void* hwnd,   // HWND
    size_t wRequestID   // WPARAM
);
ccall((:tapiRequestDrop, "TAPI32.dll"), stdcall, Int32,
      (Ptr{Cvoid}, Csize_t),
      hwnd, wRequestID)
# hwnd : HWND -> Ptr{Cvoid}
# wRequestID : WPARAM -> Csize_t
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t tapiRequestDrop(
    void* hwnd,
    uintptr_t wRequestID);
]]
local tapi32 = ffi.load("tapi32")
-- tapi32.tapiRequestDrop(hwnd, wRequestID)
-- hwnd : HWND
-- wRequestID : WPARAM
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('TAPI32.dll');
const tapiRequestDrop = lib.func('__stdcall', 'tapiRequestDrop', 'int32_t', ['void *', 'uintptr_t']);
// tapiRequestDrop(hwnd, wRequestID)
// hwnd : HWND -> 'void *'
// wRequestID : WPARAM -> 'uintptr_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("TAPI32.dll", {
  tapiRequestDrop: { parameters: ["pointer", "usize"], result: "i32" },
});
// lib.symbols.tapiRequestDrop(hwnd, wRequestID)
// hwnd : HWND -> "pointer"
// wRequestID : WPARAM -> "usize"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t tapiRequestDrop(
    void* hwnd,
    size_t wRequestID);
C, "TAPI32.dll");
// $ffi->tapiRequestDrop(hwnd, wRequestID);
// hwnd : HWND
// wRequestID : WPARAM
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Tapi32 extends StdCallLibrary {
    Tapi32 INSTANCE = Native.load("tapi32", Tapi32.class);
    int tapiRequestDrop(
        Pointer hwnd,   // HWND
        long wRequestID   // WPARAM
    );
}
@[Link("tapi32")]
lib LibTAPI32
  fun tapiRequestDrop = tapiRequestDrop(
    hwnd : Void*,   # HWND
    wRequestID : LibC::SizeT   # WPARAM
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef tapiRequestDropNative = Int32 Function(Pointer<Void>, UintPtr);
typedef tapiRequestDropDart = int Function(Pointer<Void>, int);
final tapiRequestDrop = DynamicLibrary.open('TAPI32.dll')
    .lookupFunction<tapiRequestDropNative, tapiRequestDropDart>('tapiRequestDrop');
// hwnd : HWND -> Pointer<Void>
// wRequestID : WPARAM -> UintPtr
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function tapiRequestDrop(
  hwnd: THandle;   // HWND
  wRequestID: NativeUInt   // WPARAM
): Integer; stdcall;
  external 'TAPI32.dll' name 'tapiRequestDrop';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "tapiRequestDrop"
  c_tapiRequestDrop :: Ptr () -> CUIntPtr -> IO Int32
-- hwnd : HWND -> Ptr ()
-- wRequestID : WPARAM -> CUIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let tapirequestdrop =
  foreign "tapiRequestDrop"
    ((ptr void) @-> size_t @-> returning int32_t)
(* hwnd : HWND -> (ptr void) *)
(* wRequestID : WPARAM -> size_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library tapi32 (t "TAPI32.dll"))
(cffi:use-foreign-library tapi32)

(cffi:defcfun ("tapiRequestDrop" tapi-request-drop :convention :stdcall) :int32
  (hwnd :pointer)   ; HWND
  (w-request-id :uint64))   ; WPARAM
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $tapiRequestDrop = Win32::API::More->new('TAPI32',
    'int tapiRequestDrop(HANDLE hwnd, WPARAM wRequestID)');
# my $ret = $tapiRequestDrop->Call($hwnd, $wRequestID);
# hwnd : HWND -> HANDLE
# wRequestID : WPARAM -> WPARAM
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。