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