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

TextPattern_get_SupportedTextSelection

関数
コントロールがサポートするテキスト選択方式を取得する。
DLLUIAutomationCore.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT TextPattern_get_SupportedTextSelection(
    HUIAPATTERNOBJECT hobj,
    SupportedTextSelection* pRetVal
);

パラメーター

名前方向
hobjHUIAPATTERNOBJECTin
pRetValSupportedTextSelection*inout

戻り値の型: 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, 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, int
; res = TextPattern_get_SupportedTextSelection(hobj, pRetVal)
; hobj : HUIAPATTERNOBJECT -> "sptr"
; pRetVal : SupportedTextSelection* in/out -> "int"
; HRESULT TextPattern_get_SupportedTextSelection(HUIAPATTERNOBJECT hobj, SupportedTextSelection* pRetVal)
#uselib "UIAutomationCore.dll"
#cfunc global TextPattern_get_SupportedTextSelection "TextPattern_get_SupportedTextSelection" intptr, int
; res = TextPattern_get_SupportedTextSelection(hobj, pRetVal)
; hobj : HUIAPATTERNOBJECT -> "intptr"
; pRetVal : SupportedTextSelection* in/out -> "int"
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   // HRESULT
function 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)。