ホーム › UI.Accessibility › AccNotifyTouchInteraction
AccNotifyTouchInteraction
関数支援技術によるタッチ操作の発生をシステムに通知する。
シグネチャ
// OLEACC.dll
#include <windows.h>
HRESULT AccNotifyTouchInteraction(
HWND hwndApp,
HWND hwndTarget,
POINT ptTarget
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hwndApp | HWND | in | タッチ操作の通知元となるアプリケーションのトップレベルウィンドウハンドル。 |
| hwndTarget | HWND | in | タッチ操作の対象となるUI要素を含むウィンドウのハンドル。 |
| ptTarget | POINT | in | タッチが発生した位置を示すスクリーン座標の点(POINT)。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// OLEACC.dll
#include <windows.h>
HRESULT AccNotifyTouchInteraction(
HWND hwndApp,
HWND hwndTarget,
POINT ptTarget
);[DllImport("OLEACC.dll", ExactSpelling = true)]
static extern int AccNotifyTouchInteraction(
IntPtr hwndApp, // HWND
IntPtr hwndTarget, // HWND
POINT ptTarget // POINT
);<DllImport("OLEACC.dll", ExactSpelling:=True)>
Public Shared Function AccNotifyTouchInteraction(
hwndApp As IntPtr, ' HWND
hwndTarget As IntPtr, ' HWND
ptTarget As POINT ' POINT
) As Integer
End Function' hwndApp : HWND
' hwndTarget : HWND
' ptTarget : POINT
Declare PtrSafe Function AccNotifyTouchInteraction Lib "oleacc" ( _
ByVal hwndApp As LongPtr, _
ByVal hwndTarget As LongPtr, _
ByVal ptTarget As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
AccNotifyTouchInteraction = ctypes.windll.oleacc.AccNotifyTouchInteraction
AccNotifyTouchInteraction.restype = ctypes.c_int
AccNotifyTouchInteraction.argtypes = [
wintypes.HANDLE, # hwndApp : HWND
wintypes.HANDLE, # hwndTarget : HWND
POINT, # ptTarget : POINT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('OLEACC.dll')
AccNotifyTouchInteraction = Fiddle::Function.new(
lib['AccNotifyTouchInteraction'],
[
Fiddle::TYPE_VOIDP, # hwndApp : HWND
Fiddle::TYPE_VOIDP, # hwndTarget : HWND
Fiddle::TYPE_VOIDP, # ptTarget : POINT
],
Fiddle::TYPE_INT)#[link(name = "oleacc")]
extern "system" {
fn AccNotifyTouchInteraction(
hwndApp: *mut core::ffi::c_void, // HWND
hwndTarget: *mut core::ffi::c_void, // HWND
ptTarget: POINT // POINT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("OLEACC.dll")]
public static extern int AccNotifyTouchInteraction(IntPtr hwndApp, IntPtr hwndTarget, POINT ptTarget);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OLEACC_AccNotifyTouchInteraction' -Namespace Win32 -PassThru
# $api::AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget)#uselib "OLEACC.dll"
#func global AccNotifyTouchInteraction "AccNotifyTouchInteraction" sptr, sptr, sptr
; AccNotifyTouchInteraction hwndApp, hwndTarget, ptTarget ; 戻り値は stat
; hwndApp : HWND -> "sptr"
; hwndTarget : HWND -> "sptr"
; ptTarget : POINT -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "OLEACC.dll"
#cfunc global AccNotifyTouchInteraction "AccNotifyTouchInteraction" sptr, sptr, int
; res = AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget)
; hwndApp : HWND -> "sptr"
; hwndTarget : HWND -> "sptr"
; ptTarget : POINT -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。; HRESULT AccNotifyTouchInteraction(HWND hwndApp, HWND hwndTarget, POINT ptTarget)
#uselib "OLEACC.dll"
#cfunc global AccNotifyTouchInteraction "AccNotifyTouchInteraction" intptr, intptr, int
; res = AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget)
; hwndApp : HWND -> "intptr"
; hwndTarget : HWND -> "intptr"
; ptTarget : POINT -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
oleacc = windows.NewLazySystemDLL("OLEACC.dll")
procAccNotifyTouchInteraction = oleacc.NewProc("AccNotifyTouchInteraction")
)
// hwndApp (HWND), hwndTarget (HWND), ptTarget (POINT)
r1, _, err := procAccNotifyTouchInteraction.Call(
uintptr(hwndApp),
uintptr(hwndTarget),
uintptr(ptTarget),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction AccNotifyTouchInteraction(
hwndApp: THandle; // HWND
hwndTarget: THandle; // HWND
ptTarget: POINT // POINT
): Integer; stdcall;
external 'OLEACC.dll' name 'AccNotifyTouchInteraction';result := DllCall("OLEACC\AccNotifyTouchInteraction"
, "Ptr", hwndApp ; HWND
, "Ptr", hwndTarget ; HWND
, "Ptr", ptTarget ; POINT
, "Int") ; return: HRESULT●AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget) = DLL("OLEACC.dll", "int AccNotifyTouchInteraction(void*, void*, void*)")
# 呼び出し: AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget)
# hwndApp : HWND -> "void*"
# hwndTarget : HWND -> "void*"
# ptTarget : POINT -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "oleacc" fn AccNotifyTouchInteraction(
hwndApp: ?*anyopaque, // HWND
hwndTarget: ?*anyopaque, // HWND
ptTarget: POINT // POINT
) callconv(std.os.windows.WINAPI) i32;proc AccNotifyTouchInteraction(
hwndApp: pointer, # HWND
hwndTarget: pointer, # HWND
ptTarget: POINT # POINT
): int32 {.importc: "AccNotifyTouchInteraction", stdcall, dynlib: "OLEACC.dll".}pragma(lib, "oleacc");
extern(Windows)
int AccNotifyTouchInteraction(
void* hwndApp, // HWND
void* hwndTarget, // HWND
POINT ptTarget // POINT
);ccall((:AccNotifyTouchInteraction, "OLEACC.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{Cvoid}, POINT),
hwndApp, hwndTarget, ptTarget)
# hwndApp : HWND -> Ptr{Cvoid}
# hwndTarget : HWND -> Ptr{Cvoid}
# ptTarget : POINT -> POINT
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t AccNotifyTouchInteraction(
void* hwndApp,
void* hwndTarget,
POINT ptTarget);
]]
local oleacc = ffi.load("oleacc")
-- oleacc.AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget)
-- hwndApp : HWND
-- hwndTarget : HWND
-- ptTarget : POINT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('OLEACC.dll');
const AccNotifyTouchInteraction = lib.func('__stdcall', 'AccNotifyTouchInteraction', 'int32_t', ['void *', 'void *', 'POINT']);
// AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget)
// hwndApp : HWND -> 'void *'
// hwndTarget : HWND -> 'void *'
// ptTarget : POINT -> 'POINT'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("OLEACC.dll", {
AccNotifyTouchInteraction: { parameters: ["pointer", "pointer", "buffer"], result: "i32" },
});
// lib.symbols.AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget)
// hwndApp : HWND -> "pointer"
// hwndTarget : HWND -> "pointer"
// ptTarget : POINT -> "buffer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t AccNotifyTouchInteraction(
void* hwndApp,
void* hwndTarget,
POINT ptTarget);
C, "OLEACC.dll");
// $ffi->AccNotifyTouchInteraction(hwndApp, hwndTarget, ptTarget);
// hwndApp : HWND
// hwndTarget : HWND
// ptTarget : POINT
// 構造体/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 Oleacc extends StdCallLibrary {
Oleacc INSTANCE = Native.load("oleacc", Oleacc.class);
int AccNotifyTouchInteraction(
Pointer hwndApp, // HWND
Pointer hwndTarget, // HWND
POINT /* extends Structure (by value) */ ptTarget // POINT
);
}@[Link("oleacc")]
lib LibOLEACC
fun AccNotifyTouchInteraction = AccNotifyTouchInteraction(
hwndApp : Void*, # HWND
hwndTarget : Void*, # HWND
ptTarget : POINT # POINT
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef AccNotifyTouchInteractionNative = Int32 Function(Pointer<Void>, Pointer<Void>, POINT);
typedef AccNotifyTouchInteractionDart = int Function(Pointer<Void>, Pointer<Void>, int);
final AccNotifyTouchInteraction = DynamicLibrary.open('OLEACC.dll')
.lookupFunction<AccNotifyTouchInteractionNative, AccNotifyTouchInteractionDart>('AccNotifyTouchInteraction');
// hwndApp : HWND -> Pointer<Void>
// hwndTarget : HWND -> Pointer<Void>
// ptTarget : POINT -> POINT
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function AccNotifyTouchInteraction(
hwndApp: THandle; // HWND
hwndTarget: THandle; // HWND
ptTarget: POINT // POINT
): Integer; stdcall;
external 'OLEACC.dll' name 'AccNotifyTouchInteraction';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "AccNotifyTouchInteraction"
c_AccNotifyTouchInteraction :: Ptr () -> Ptr () -> POINT -> IO Int32
-- hwndApp : HWND -> Ptr ()
-- hwndTarget : HWND -> Ptr ()
-- ptTarget : POINT -> POINT
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
-- ※値渡し構造体は GHC FFI で直接渡せません。Ptr で渡すラッパ(C側)経由にしてください。open Ctypes
open Foreign
let accnotifytouchinteraction =
foreign "AccNotifyTouchInteraction"
((ptr void) @-> (ptr void) @-> POINT @-> returning int32_t)
(* hwndApp : HWND -> (ptr void) *)
(* hwndTarget : HWND -> (ptr void) *)
(* ptTarget : POINT -> POINT *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library oleacc (t "OLEACC.dll"))
(cffi:use-foreign-library oleacc)
(cffi:defcfun ("AccNotifyTouchInteraction" acc-notify-touch-interaction :convention :stdcall) :int32
(hwnd-app :pointer) ; HWND
(hwnd-target :pointer) ; HWND
(pt-target (:struct point))) ; POINT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $AccNotifyTouchInteraction = Win32::API::More->new('OLEACC',
'int AccNotifyTouchInteraction(HANDLE hwndApp, HANDLE hwndTarget, LPVOID ptTarget)');
# my $ret = $AccNotifyTouchInteraction->Call($hwndApp, $hwndTarget, $ptTarget);
# hwndApp : HWND -> HANDLE
# hwndTarget : HWND -> HANDLE
# ptTarget : POINT -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型