Win32 API 日本語リファレンス
ホームUI.InteractionContext › RemovePointerInteractionContext

RemovePointerInteractionContext

関数
インタラクションコンテキストからポインターを削除する。
DLLNInput.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT RemovePointerInteractionContext(
    HINTERACTIONCONTEXT interactionContext,
    DWORD pointerId
);

パラメーター

名前方向説明
interactionContextHINTERACTIONCONTEXTin対象インタラクションコンテキストのハンドルを指定する。
pointerIdDWORDinコンテキストの追跡対象から除外するポインタのIDを指定する。

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT RemovePointerInteractionContext(
    HINTERACTIONCONTEXT interactionContext,
    DWORD pointerId
);
[DllImport("NInput.dll", ExactSpelling = true)]
static extern int RemovePointerInteractionContext(
    IntPtr interactionContext,   // HINTERACTIONCONTEXT
    uint pointerId   // DWORD
);
<DllImport("NInput.dll", ExactSpelling:=True)>
Public Shared Function RemovePointerInteractionContext(
    interactionContext As IntPtr,   ' HINTERACTIONCONTEXT
    pointerId As UInteger   ' DWORD
) As Integer
End Function
' interactionContext : HINTERACTIONCONTEXT
' pointerId : DWORD
Declare PtrSafe Function RemovePointerInteractionContext Lib "ninput" ( _
    ByVal interactionContext As LongPtr, _
    ByVal pointerId As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RemovePointerInteractionContext = ctypes.windll.ninput.RemovePointerInteractionContext
RemovePointerInteractionContext.restype = ctypes.c_int
RemovePointerInteractionContext.argtypes = [
    wintypes.HANDLE,  # interactionContext : HINTERACTIONCONTEXT
    wintypes.DWORD,  # pointerId : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	ninput = windows.NewLazySystemDLL("NInput.dll")
	procRemovePointerInteractionContext = ninput.NewProc("RemovePointerInteractionContext")
)

// interactionContext (HINTERACTIONCONTEXT), pointerId (DWORD)
r1, _, err := procRemovePointerInteractionContext.Call(
	uintptr(interactionContext),
	uintptr(pointerId),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function RemovePointerInteractionContext(
  interactionContext: THandle;   // HINTERACTIONCONTEXT
  pointerId: DWORD   // DWORD
): Integer; stdcall;
  external 'NInput.dll' name 'RemovePointerInteractionContext';
result := DllCall("NInput\RemovePointerInteractionContext"
    , "Ptr", interactionContext   ; HINTERACTIONCONTEXT
    , "UInt", pointerId   ; DWORD
    , "Int")   ; return: HRESULT
●RemovePointerInteractionContext(interactionContext, pointerId) = DLL("NInput.dll", "int RemovePointerInteractionContext(void*, dword)")
# 呼び出し: RemovePointerInteractionContext(interactionContext, pointerId)
# interactionContext : HINTERACTIONCONTEXT -> "void*"
# pointerId : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "ninput" fn RemovePointerInteractionContext(
    interactionContext: ?*anyopaque, // HINTERACTIONCONTEXT
    pointerId: u32 // DWORD
) callconv(std.os.windows.WINAPI) i32;
proc RemovePointerInteractionContext(
    interactionContext: pointer,  # HINTERACTIONCONTEXT
    pointerId: uint32  # DWORD
): int32 {.importc: "RemovePointerInteractionContext", stdcall, dynlib: "NInput.dll".}
pragma(lib, "ninput");
extern(Windows)
int RemovePointerInteractionContext(
    void* interactionContext,   // HINTERACTIONCONTEXT
    uint pointerId   // DWORD
);
ccall((:RemovePointerInteractionContext, "NInput.dll"), stdcall, Int32,
      (Ptr{Cvoid}, UInt32),
      interactionContext, pointerId)
# interactionContext : HINTERACTIONCONTEXT -> Ptr{Cvoid}
# pointerId : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t RemovePointerInteractionContext(
    void* interactionContext,
    uint32_t pointerId);
]]
local ninput = ffi.load("ninput")
-- ninput.RemovePointerInteractionContext(interactionContext, pointerId)
-- interactionContext : HINTERACTIONCONTEXT
-- pointerId : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('NInput.dll');
const RemovePointerInteractionContext = lib.func('__stdcall', 'RemovePointerInteractionContext', 'int32_t', ['void *', 'uint32_t']);
// RemovePointerInteractionContext(interactionContext, pointerId)
// interactionContext : HINTERACTIONCONTEXT -> 'void *'
// pointerId : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("NInput.dll", {
  RemovePointerInteractionContext: { parameters: ["pointer", "u32"], result: "i32" },
});
// lib.symbols.RemovePointerInteractionContext(interactionContext, pointerId)
// interactionContext : HINTERACTIONCONTEXT -> "pointer"
// pointerId : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t RemovePointerInteractionContext(
    void* interactionContext,
    uint32_t pointerId);
C, "NInput.dll");
// $ffi->RemovePointerInteractionContext(interactionContext, pointerId);
// interactionContext : HINTERACTIONCONTEXT
// pointerId : DWORD
// 構造体/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 Ninput extends StdCallLibrary {
    Ninput INSTANCE = Native.load("ninput", Ninput.class);
    int RemovePointerInteractionContext(
        Pointer interactionContext,   // HINTERACTIONCONTEXT
        int pointerId   // DWORD
    );
}
@[Link("ninput")]
lib LibNInput
  fun RemovePointerInteractionContext = RemovePointerInteractionContext(
    interactionContext : Void*,   # HINTERACTIONCONTEXT
    pointerId : UInt32   # DWORD
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef RemovePointerInteractionContextNative = Int32 Function(Pointer<Void>, Uint32);
typedef RemovePointerInteractionContextDart = int Function(Pointer<Void>, int);
final RemovePointerInteractionContext = DynamicLibrary.open('NInput.dll')
    .lookupFunction<RemovePointerInteractionContextNative, RemovePointerInteractionContextDart>('RemovePointerInteractionContext');
// interactionContext : HINTERACTIONCONTEXT -> Pointer<Void>
// pointerId : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function RemovePointerInteractionContext(
  interactionContext: THandle;   // HINTERACTIONCONTEXT
  pointerId: DWORD   // DWORD
): Integer; stdcall;
  external 'NInput.dll' name 'RemovePointerInteractionContext';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "RemovePointerInteractionContext"
  c_RemovePointerInteractionContext :: Ptr () -> Word32 -> IO Int32
-- interactionContext : HINTERACTIONCONTEXT -> Ptr ()
-- pointerId : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let removepointerinteractioncontext =
  foreign "RemovePointerInteractionContext"
    ((ptr void) @-> uint32_t @-> returning int32_t)
(* interactionContext : HINTERACTIONCONTEXT -> (ptr void) *)
(* pointerId : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library ninput (t "NInput.dll"))
(cffi:use-foreign-library ninput)

(cffi:defcfun ("RemovePointerInteractionContext" remove-pointer-interaction-context :convention :stdcall) :int32
  (interaction-context :pointer)   ; HINTERACTIONCONTEXT
  (pointer-id :uint32))   ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $RemovePointerInteractionContext = Win32::API::More->new('NInput',
    'int RemovePointerInteractionContext(HANDLE interactionContext, DWORD pointerId)');
# my $ret = $RemovePointerInteractionContext->Call($interactionContext, $pointerId);
# interactionContext : HINTERACTIONCONTEXT -> HANDLE
# pointerId : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。