ホーム › UI.Accessibility › TextPattern_get_DocumentRange
TextPattern_get_DocumentRange
関数ドキュメント全体を表すテキスト範囲を取得する。
シグネチャ
// UIAutomationCore.dll
#include <windows.h>
HRESULT TextPattern_get_DocumentRange(
HUIAPATTERNOBJECT hobj,
HUIATEXTRANGE* pRetVal
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hobj | HUIAPATTERNOBJECT | in |
| pRetVal | HUIATEXTRANGE* | inout |
戻り値の型: HRESULT
各言語での呼び出し定義
// UIAutomationCore.dll
#include <windows.h>
HRESULT TextPattern_get_DocumentRange(
HUIAPATTERNOBJECT hobj,
HUIATEXTRANGE* pRetVal
);[DllImport("UIAutomationCore.dll", ExactSpelling = true)]
static extern int TextPattern_get_DocumentRange(
IntPtr hobj, // HUIAPATTERNOBJECT
IntPtr pRetVal // HUIATEXTRANGE* in/out
);<DllImport("UIAutomationCore.dll", ExactSpelling:=True)>
Public Shared Function TextPattern_get_DocumentRange(
hobj As IntPtr, ' HUIAPATTERNOBJECT
pRetVal As IntPtr ' HUIATEXTRANGE* in/out
) As Integer
End Function' hobj : HUIAPATTERNOBJECT
' pRetVal : HUIATEXTRANGE* in/out
Declare PtrSafe Function TextPattern_get_DocumentRange Lib "uiautomationcore" ( _
ByVal hobj As LongPtr, _
ByVal pRetVal As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
TextPattern_get_DocumentRange = ctypes.windll.uiautomationcore.TextPattern_get_DocumentRange
TextPattern_get_DocumentRange.restype = ctypes.c_int
TextPattern_get_DocumentRange.argtypes = [
wintypes.HANDLE, # hobj : HUIAPATTERNOBJECT
ctypes.c_void_p, # pRetVal : HUIATEXTRANGE* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('UIAutomationCore.dll')
TextPattern_get_DocumentRange = Fiddle::Function.new(
lib['TextPattern_get_DocumentRange'],
[
Fiddle::TYPE_VOIDP, # hobj : HUIAPATTERNOBJECT
Fiddle::TYPE_VOIDP, # pRetVal : HUIATEXTRANGE* in/out
],
Fiddle::TYPE_INT)#[link(name = "uiautomationcore")]
extern "system" {
fn TextPattern_get_DocumentRange(
hobj: *mut core::ffi::c_void, // HUIAPATTERNOBJECT
pRetVal: *mut *mut core::ffi::c_void // HUIATEXTRANGE* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("UIAutomationCore.dll")]
public static extern int TextPattern_get_DocumentRange(IntPtr hobj, IntPtr pRetVal);
"@
$api = Add-Type -MemberDefinition $sig -Name 'UIAutomationCore_TextPattern_get_DocumentRange' -Namespace Win32 -PassThru
# $api::TextPattern_get_DocumentRange(hobj, pRetVal)#uselib "UIAutomationCore.dll"
#func global TextPattern_get_DocumentRange "TextPattern_get_DocumentRange" sptr, sptr
; TextPattern_get_DocumentRange hobj, pRetVal ; 戻り値は stat
; hobj : HUIAPATTERNOBJECT -> "sptr"
; pRetVal : HUIATEXTRANGE* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "UIAutomationCore.dll"
#cfunc global TextPattern_get_DocumentRange "TextPattern_get_DocumentRange" sptr, sptr
; res = TextPattern_get_DocumentRange(hobj, pRetVal)
; hobj : HUIAPATTERNOBJECT -> "sptr"
; pRetVal : HUIATEXTRANGE* in/out -> "sptr"; HRESULT TextPattern_get_DocumentRange(HUIAPATTERNOBJECT hobj, HUIATEXTRANGE* pRetVal)
#uselib "UIAutomationCore.dll"
#cfunc global TextPattern_get_DocumentRange "TextPattern_get_DocumentRange" intptr, intptr
; res = TextPattern_get_DocumentRange(hobj, pRetVal)
; hobj : HUIAPATTERNOBJECT -> "intptr"
; pRetVal : HUIATEXTRANGE* in/out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
uiautomationcore = windows.NewLazySystemDLL("UIAutomationCore.dll")
procTextPattern_get_DocumentRange = uiautomationcore.NewProc("TextPattern_get_DocumentRange")
)
// hobj (HUIAPATTERNOBJECT), pRetVal (HUIATEXTRANGE* in/out)
r1, _, err := procTextPattern_get_DocumentRange.Call(
uintptr(hobj),
uintptr(pRetVal),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction TextPattern_get_DocumentRange(
hobj: THandle; // HUIAPATTERNOBJECT
pRetVal: Pointer // HUIATEXTRANGE* in/out
): Integer; stdcall;
external 'UIAutomationCore.dll' name 'TextPattern_get_DocumentRange';result := DllCall("UIAutomationCore\TextPattern_get_DocumentRange"
, "Ptr", hobj ; HUIAPATTERNOBJECT
, "Ptr", pRetVal ; HUIATEXTRANGE* in/out
, "Int") ; return: HRESULT●TextPattern_get_DocumentRange(hobj, pRetVal) = DLL("UIAutomationCore.dll", "int TextPattern_get_DocumentRange(void*, void*)")
# 呼び出し: TextPattern_get_DocumentRange(hobj, pRetVal)
# hobj : HUIAPATTERNOBJECT -> "void*"
# pRetVal : HUIATEXTRANGE* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。