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

SelectionItemPattern_Select

関数
SelectionItemパターンで要素を単独選択する。
DLLUIAutomationCore.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT SelectionItemPattern_Select(
    HUIAPATTERNOBJECT hobj
);

パラメーター

名前方向
hobjHUIAPATTERNOBJECTin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT SelectionItemPattern_Select(
    HUIAPATTERNOBJECT hobj
);
[DllImport("UIAutomationCore.dll", ExactSpelling = true)]
static extern int SelectionItemPattern_Select(
    IntPtr hobj   // HUIAPATTERNOBJECT
);
<DllImport("UIAutomationCore.dll", ExactSpelling:=True)>
Public Shared Function SelectionItemPattern_Select(
    hobj As IntPtr   ' HUIAPATTERNOBJECT
) As Integer
End Function
' hobj : HUIAPATTERNOBJECT
Declare PtrSafe Function SelectionItemPattern_Select 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

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

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

var (
	uiautomationcore = windows.NewLazySystemDLL("UIAutomationCore.dll")
	procSelectionItemPattern_Select = uiautomationcore.NewProc("SelectionItemPattern_Select")
)

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