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

ExpandCollapsePattern_Expand

関数
ExpandCollapseパターンで要素を展開する。
DLLUIAutomationCore.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT ExpandCollapsePattern_Expand(
    HUIAPATTERNOBJECT hobj
);

パラメーター

名前方向説明
hobjHUIAPATTERNOBJECTinExpandCollapsePatternを表すパターンオブジェクトハンドル。対象要素を展開する。

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

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

lib = Fiddle.dlopen('UIAutomationCore.dll')
ExpandCollapsePattern_Expand = Fiddle::Function.new(
  lib['ExpandCollapsePattern_Expand'],
  [
    Fiddle::TYPE_VOIDP,  # hobj : HUIAPATTERNOBJECT
  ],
  Fiddle::TYPE_INT)
#[link(name = "uiautomationcore")]
extern "system" {
    fn ExpandCollapsePattern_Expand(
        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 ExpandCollapsePattern_Expand(IntPtr hobj);
"@
$api = Add-Type -MemberDefinition $sig -Name 'UIAutomationCore_ExpandCollapsePattern_Expand' -Namespace Win32 -PassThru
# $api::ExpandCollapsePattern_Expand(hobj)
#uselib "UIAutomationCore.dll"
#func global ExpandCollapsePattern_Expand "ExpandCollapsePattern_Expand" sptr
; ExpandCollapsePattern_Expand hobj   ; 戻り値は stat
; hobj : HUIAPATTERNOBJECT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "UIAutomationCore.dll"
#cfunc global ExpandCollapsePattern_Expand "ExpandCollapsePattern_Expand" sptr
; res = ExpandCollapsePattern_Expand(hobj)
; hobj : HUIAPATTERNOBJECT -> "sptr"
; HRESULT ExpandCollapsePattern_Expand(HUIAPATTERNOBJECT hobj)
#uselib "UIAutomationCore.dll"
#cfunc global ExpandCollapsePattern_Expand "ExpandCollapsePattern_Expand" intptr
; res = ExpandCollapsePattern_Expand(hobj)
; hobj : HUIAPATTERNOBJECT -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	uiautomationcore = windows.NewLazySystemDLL("UIAutomationCore.dll")
	procExpandCollapsePattern_Expand = uiautomationcore.NewProc("ExpandCollapsePattern_Expand")
)

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