ホーム › UI.InteractionContext › ProcessInertiaInteractionContext
ProcessInertiaInteractionContext
関数慣性動作を処理してインタラクションを継続する。
シグネチャ
// NInput.dll
#include <windows.h>
HRESULT ProcessInertiaInteractionContext(
HINTERACTIONCONTEXT interactionContext
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| interactionContext | HINTERACTIONCONTEXT | in | 慣性処理を進行させる対象インタラクションコンテキストのハンドルを指定する。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// NInput.dll
#include <windows.h>
HRESULT ProcessInertiaInteractionContext(
HINTERACTIONCONTEXT interactionContext
);[DllImport("NInput.dll", ExactSpelling = true)]
static extern int ProcessInertiaInteractionContext(
IntPtr interactionContext // HINTERACTIONCONTEXT
);<DllImport("NInput.dll", ExactSpelling:=True)>
Public Shared Function ProcessInertiaInteractionContext(
interactionContext As IntPtr ' HINTERACTIONCONTEXT
) As Integer
End Function' interactionContext : HINTERACTIONCONTEXT
Declare PtrSafe Function ProcessInertiaInteractionContext Lib "ninput" ( _
ByVal interactionContext As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ProcessInertiaInteractionContext = ctypes.windll.ninput.ProcessInertiaInteractionContext
ProcessInertiaInteractionContext.restype = ctypes.c_int
ProcessInertiaInteractionContext.argtypes = [
wintypes.HANDLE, # interactionContext : HINTERACTIONCONTEXT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('NInput.dll')
ProcessInertiaInteractionContext = Fiddle::Function.new(
lib['ProcessInertiaInteractionContext'],
[
Fiddle::TYPE_VOIDP, # interactionContext : HINTERACTIONCONTEXT
],
Fiddle::TYPE_INT)#[link(name = "ninput")]
extern "system" {
fn ProcessInertiaInteractionContext(
interactionContext: *mut core::ffi::c_void // HINTERACTIONCONTEXT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("NInput.dll")]
public static extern int ProcessInertiaInteractionContext(IntPtr interactionContext);
"@
$api = Add-Type -MemberDefinition $sig -Name 'NInput_ProcessInertiaInteractionContext' -Namespace Win32 -PassThru
# $api::ProcessInertiaInteractionContext(interactionContext)#uselib "NInput.dll"
#func global ProcessInertiaInteractionContext "ProcessInertiaInteractionContext" sptr
; ProcessInertiaInteractionContext interactionContext ; 戻り値は stat
; interactionContext : HINTERACTIONCONTEXT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "NInput.dll"
#cfunc global ProcessInertiaInteractionContext "ProcessInertiaInteractionContext" sptr
; res = ProcessInertiaInteractionContext(interactionContext)
; interactionContext : HINTERACTIONCONTEXT -> "sptr"; HRESULT ProcessInertiaInteractionContext(HINTERACTIONCONTEXT interactionContext)
#uselib "NInput.dll"
#cfunc global ProcessInertiaInteractionContext "ProcessInertiaInteractionContext" intptr
; res = ProcessInertiaInteractionContext(interactionContext)
; interactionContext : HINTERACTIONCONTEXT -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
ninput = windows.NewLazySystemDLL("NInput.dll")
procProcessInertiaInteractionContext = ninput.NewProc("ProcessInertiaInteractionContext")
)
// interactionContext (HINTERACTIONCONTEXT)
r1, _, err := procProcessInertiaInteractionContext.Call(
uintptr(interactionContext),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction ProcessInertiaInteractionContext(
interactionContext: THandle // HINTERACTIONCONTEXT
): Integer; stdcall;
external 'NInput.dll' name 'ProcessInertiaInteractionContext';result := DllCall("NInput\ProcessInertiaInteractionContext"
, "Ptr", interactionContext ; HINTERACTIONCONTEXT
, "Int") ; return: HRESULT●ProcessInertiaInteractionContext(interactionContext) = DLL("NInput.dll", "int ProcessInertiaInteractionContext(void*)")
# 呼び出し: ProcessInertiaInteractionContext(interactionContext)
# interactionContext : HINTERACTIONCONTEXT -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "ninput" fn ProcessInertiaInteractionContext(
interactionContext: ?*anyopaque // HINTERACTIONCONTEXT
) callconv(std.os.windows.WINAPI) i32;proc ProcessInertiaInteractionContext(
interactionContext: pointer # HINTERACTIONCONTEXT
): int32 {.importc: "ProcessInertiaInteractionContext", stdcall, dynlib: "NInput.dll".}pragma(lib, "ninput");
extern(Windows)
int ProcessInertiaInteractionContext(
void* interactionContext // HINTERACTIONCONTEXT
);ccall((:ProcessInertiaInteractionContext, "NInput.dll"), stdcall, Int32,
(Ptr{Cvoid},),
interactionContext)
# interactionContext : HINTERACTIONCONTEXT -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t ProcessInertiaInteractionContext(
void* interactionContext);
]]
local ninput = ffi.load("ninput")
-- ninput.ProcessInertiaInteractionContext(interactionContext)
-- interactionContext : HINTERACTIONCONTEXT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('NInput.dll');
const ProcessInertiaInteractionContext = lib.func('__stdcall', 'ProcessInertiaInteractionContext', 'int32_t', ['void *']);
// ProcessInertiaInteractionContext(interactionContext)
// interactionContext : HINTERACTIONCONTEXT -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("NInput.dll", {
ProcessInertiaInteractionContext: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.ProcessInertiaInteractionContext(interactionContext)
// interactionContext : HINTERACTIONCONTEXT -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t ProcessInertiaInteractionContext(
void* interactionContext);
C, "NInput.dll");
// $ffi->ProcessInertiaInteractionContext(interactionContext);
// interactionContext : HINTERACTIONCONTEXT
// 構造体/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 ProcessInertiaInteractionContext(
Pointer interactionContext // HINTERACTIONCONTEXT
);
}@[Link("ninput")]
lib LibNInput
fun ProcessInertiaInteractionContext = ProcessInertiaInteractionContext(
interactionContext : Void* # HINTERACTIONCONTEXT
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef ProcessInertiaInteractionContextNative = Int32 Function(Pointer<Void>);
typedef ProcessInertiaInteractionContextDart = int Function(Pointer<Void>);
final ProcessInertiaInteractionContext = DynamicLibrary.open('NInput.dll')
.lookupFunction<ProcessInertiaInteractionContextNative, ProcessInertiaInteractionContextDart>('ProcessInertiaInteractionContext');
// interactionContext : HINTERACTIONCONTEXT -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function ProcessInertiaInteractionContext(
interactionContext: THandle // HINTERACTIONCONTEXT
): Integer; stdcall;
external 'NInput.dll' name 'ProcessInertiaInteractionContext';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "ProcessInertiaInteractionContext"
c_ProcessInertiaInteractionContext :: Ptr () -> IO Int32
-- interactionContext : HINTERACTIONCONTEXT -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let processinertiainteractioncontext =
foreign "ProcessInertiaInteractionContext"
((ptr void) @-> returning int32_t)
(* interactionContext : HINTERACTIONCONTEXT -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library ninput (t "NInput.dll"))
(cffi:use-foreign-library ninput)
(cffi:defcfun ("ProcessInertiaInteractionContext" process-inertia-interaction-context :convention :stdcall) :int32
(interaction-context :pointer)) ; HINTERACTIONCONTEXT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $ProcessInertiaInteractionContext = Win32::API::More->new('NInput',
'int ProcessInertiaInteractionContext(HANDLE interactionContext)');
# my $ret = $ProcessInertiaInteractionContext->Call($interactionContext);
# interactionContext : HINTERACTIONCONTEXT -> HANDLE
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。