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

TextRange_RemoveFromSelection

関数
テキスト範囲を現在の選択から除外する。
DLLUIAutomationCore.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT TextRange_RemoveFromSelection(
    HUIATEXTRANGE hobj
);

パラメーター

名前方向
hobjHUIATEXTRANGEin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT TextRange_RemoveFromSelection(
    HUIATEXTRANGE hobj
);
[DllImport("UIAutomationCore.dll", ExactSpelling = true)]
static extern int TextRange_RemoveFromSelection(
    IntPtr hobj   // HUIATEXTRANGE
);
<DllImport("UIAutomationCore.dll", ExactSpelling:=True)>
Public Shared Function TextRange_RemoveFromSelection(
    hobj As IntPtr   ' HUIATEXTRANGE
) As Integer
End Function
' hobj : HUIATEXTRANGE
Declare PtrSafe Function TextRange_RemoveFromSelection Lib "uiautomationcore" ( _
    ByVal hobj As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

TextRange_RemoveFromSelection = ctypes.windll.uiautomationcore.TextRange_RemoveFromSelection
TextRange_RemoveFromSelection.restype = ctypes.c_int
TextRange_RemoveFromSelection.argtypes = [
    wintypes.HANDLE,  # hobj : HUIATEXTRANGE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('UIAutomationCore.dll')
TextRange_RemoveFromSelection = Fiddle::Function.new(
  lib['TextRange_RemoveFromSelection'],
  [
    Fiddle::TYPE_VOIDP,  # hobj : HUIATEXTRANGE
  ],
  Fiddle::TYPE_INT)
#[link(name = "uiautomationcore")]
extern "system" {
    fn TextRange_RemoveFromSelection(
        hobj: *mut core::ffi::c_void  // HUIATEXTRANGE
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("UIAutomationCore.dll")]
public static extern int TextRange_RemoveFromSelection(IntPtr hobj);
"@
$api = Add-Type -MemberDefinition $sig -Name 'UIAutomationCore_TextRange_RemoveFromSelection' -Namespace Win32 -PassThru
# $api::TextRange_RemoveFromSelection(hobj)
#uselib "UIAutomationCore.dll"
#func global TextRange_RemoveFromSelection "TextRange_RemoveFromSelection" sptr
; TextRange_RemoveFromSelection hobj   ; 戻り値は stat
; hobj : HUIATEXTRANGE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "UIAutomationCore.dll"
#cfunc global TextRange_RemoveFromSelection "TextRange_RemoveFromSelection" sptr
; res = TextRange_RemoveFromSelection(hobj)
; hobj : HUIATEXTRANGE -> "sptr"
; HRESULT TextRange_RemoveFromSelection(HUIATEXTRANGE hobj)
#uselib "UIAutomationCore.dll"
#cfunc global TextRange_RemoveFromSelection "TextRange_RemoveFromSelection" intptr
; res = TextRange_RemoveFromSelection(hobj)
; hobj : HUIATEXTRANGE -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	uiautomationcore = windows.NewLazySystemDLL("UIAutomationCore.dll")
	procTextRange_RemoveFromSelection = uiautomationcore.NewProc("TextRange_RemoveFromSelection")
)

// hobj (HUIATEXTRANGE)
r1, _, err := procTextRange_RemoveFromSelection.Call(
	uintptr(hobj),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function TextRange_RemoveFromSelection(
  hobj: THandle   // HUIATEXTRANGE
): Integer; stdcall;
  external 'UIAutomationCore.dll' name 'TextRange_RemoveFromSelection';
result := DllCall("UIAutomationCore\TextRange_RemoveFromSelection"
    , "Ptr", hobj   ; HUIATEXTRANGE
    , "Int")   ; return: HRESULT
●TextRange_RemoveFromSelection(hobj) = DLL("UIAutomationCore.dll", "int TextRange_RemoveFromSelection(void*)")
# 呼び出し: TextRange_RemoveFromSelection(hobj)
# hobj : HUIATEXTRANGE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。