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

UIAutomationPatternInfo

構造体
サイズx64: 112 バイト / x86: 80 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
guidGUID16+0+0コントロールパターンを一意に識別するGUID。
pProgrammaticNameLPWSTR8/4+16+16パターンのプログラム名へのワイド文字列ポインタ。
providerInterfaceIdGUID16+24+20プロバイダー側インターフェイスのIID。
clientInterfaceIdGUID16+40+36クライアント側インターフェイスのIID。
cPropertiesDWORD4+56+52パターンが持つプロパティの数。
pPropertiesUIAutomationPropertyInfo*8/4+64+56プロパティ情報配列へのポインタ。
cMethodsDWORD4+72+60パターンが持つメソッドの数。
pMethodsUIAutomationMethodInfo*8/4+80+64メソッド情報配列へのポインタ。
cEventsDWORD4+88+68パターンが持つイベントの数。
pEventsUIAutomationEventInfo*8/4+96+72イベント情報配列へのポインタ。
pPatternHandlerIUIAutomationPatternHandler*8/4+104+76パターン呼び出しを仲介するハンドラーインターフェイスへのポインタ。

各言語での定義

#include <windows.h>

// UIAutomationPatternInfo  (x64 112 / x86 80 バイト)
typedef struct UIAutomationPatternInfo {
    GUID guid;
    LPWSTR pProgrammaticName;
    GUID providerInterfaceId;
    GUID clientInterfaceId;
    DWORD cProperties;
    UIAutomationPropertyInfo* pProperties;
    DWORD cMethods;
    UIAutomationMethodInfo* pMethods;
    DWORD cEvents;
    UIAutomationEventInfo* pEvents;
    IUIAutomationPatternHandler* pPatternHandler;
} UIAutomationPatternInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct UIAutomationPatternInfo
{
    public Guid guid;
    public IntPtr pProgrammaticName;
    public Guid providerInterfaceId;
    public Guid clientInterfaceId;
    public uint cProperties;
    public IntPtr pProperties;
    public uint cMethods;
    public IntPtr pMethods;
    public uint cEvents;
    public IntPtr pEvents;
    public IntPtr pPatternHandler;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure UIAutomationPatternInfo
    Public guid As Guid
    Public pProgrammaticName As IntPtr
    Public providerInterfaceId As Guid
    Public clientInterfaceId As Guid
    Public cProperties As UInteger
    Public pProperties As IntPtr
    Public cMethods As UInteger
    Public pMethods As IntPtr
    Public cEvents As UInteger
    Public pEvents As IntPtr
    Public pPatternHandler As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class UIAutomationPatternInfo(ctypes.Structure):
    _fields_ = [
        ("guid", GUID),
        ("pProgrammaticName", ctypes.c_void_p),
        ("providerInterfaceId", GUID),
        ("clientInterfaceId", GUID),
        ("cProperties", wintypes.DWORD),
        ("pProperties", ctypes.c_void_p),
        ("cMethods", wintypes.DWORD),
        ("pMethods", ctypes.c_void_p),
        ("cEvents", wintypes.DWORD),
        ("pEvents", ctypes.c_void_p),
        ("pPatternHandler", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct UIAutomationPatternInfo {
    pub guid: GUID,
    pub pProgrammaticName: *mut core::ffi::c_void,
    pub providerInterfaceId: GUID,
    pub clientInterfaceId: GUID,
    pub cProperties: u32,
    pub pProperties: *mut core::ffi::c_void,
    pub cMethods: u32,
    pub pMethods: *mut core::ffi::c_void,
    pub cEvents: u32,
    pub pEvents: *mut core::ffi::c_void,
    pub pPatternHandler: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type UIAutomationPatternInfo struct {
	guid windows.GUID
	pProgrammaticName uintptr
	providerInterfaceId windows.GUID
	clientInterfaceId windows.GUID
	cProperties uint32
	pProperties uintptr
	cMethods uint32
	pMethods uintptr
	cEvents uint32
	pEvents uintptr
	pPatternHandler uintptr
}
type
  UIAutomationPatternInfo = record
    guid: TGUID;
    pProgrammaticName: Pointer;
    providerInterfaceId: TGUID;
    clientInterfaceId: TGUID;
    cProperties: DWORD;
    pProperties: Pointer;
    cMethods: DWORD;
    pMethods: Pointer;
    cEvents: DWORD;
    pEvents: Pointer;
    pPatternHandler: Pointer;
  end;
const UIAutomationPatternInfo = extern struct {
    guid: GUID,
    pProgrammaticName: ?*anyopaque,
    providerInterfaceId: GUID,
    clientInterfaceId: GUID,
    cProperties: u32,
    pProperties: ?*anyopaque,
    cMethods: u32,
    pMethods: ?*anyopaque,
    cEvents: u32,
    pEvents: ?*anyopaque,
    pPatternHandler: ?*anyopaque,
};
type
  UIAutomationPatternInfo {.bycopy.} = object
    guid: GUID
    pProgrammaticName: pointer
    providerInterfaceId: GUID
    clientInterfaceId: GUID
    cProperties: uint32
    pProperties: pointer
    cMethods: uint32
    pMethods: pointer
    cEvents: uint32
    pEvents: pointer
    pPatternHandler: pointer
struct UIAutomationPatternInfo
{
    GUID guid;
    void* pProgrammaticName;
    GUID providerInterfaceId;
    GUID clientInterfaceId;
    uint cProperties;
    void* pProperties;
    uint cMethods;
    void* pMethods;
    uint cEvents;
    void* pEvents;
    void* pPatternHandler;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; UIAutomationPatternInfo サイズ: 80 バイト(x86)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; guid : GUID (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; pProgrammaticName : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; providerInterfaceId : GUID (+20, 16byte)  varptr(st)+20 を基点に操作(16byte:入れ子/配列)
; clientInterfaceId : GUID (+36, 16byte)  varptr(st)+36 を基点に操作(16byte:入れ子/配列)
; cProperties : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; pProperties : UIAutomationPropertyInfo* (+56, 4byte)  varptr(st)+56 を基点に操作(4byte:入れ子/配列)
; cMethods : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; pMethods : UIAutomationMethodInfo* (+64, 4byte)  varptr(st)+64 を基点に操作(4byte:入れ子/配列)
; cEvents : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; pEvents : UIAutomationEventInfo* (+72, 4byte)  varptr(st)+72 を基点に操作(4byte:入れ子/配列)
; pPatternHandler : IUIAutomationPatternHandler* (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; UIAutomationPatternInfo サイズ: 112 バイト(x64)
dim st, 28    ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; guid : GUID (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; pProgrammaticName : LPWSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; providerInterfaceId : GUID (+24, 16byte)  varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; clientInterfaceId : GUID (+40, 16byte)  varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; cProperties : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; pProperties : UIAutomationPropertyInfo* (+64, 8byte)  varptr(st)+64 を基点に操作(8byte:入れ子/配列)
; cMethods : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; pMethods : UIAutomationMethodInfo* (+80, 8byte)  varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; cEvents : DWORD (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; pEvents : UIAutomationEventInfo* (+96, 8byte)  varptr(st)+96 を基点に操作(8byte:入れ子/配列)
; pPatternHandler : IUIAutomationPatternHandler* (+104, 8byte)  qpoke st,104,値 / qpeek(st,104)  ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global UIAutomationPatternInfo
    #field GUID guid
    #field intptr pProgrammaticName
    #field GUID providerInterfaceId
    #field GUID clientInterfaceId
    #field int cProperties
    #field intptr pProperties
    #field int cMethods
    #field intptr pMethods
    #field int cEvents
    #field intptr pEvents
    #field intptr pPatternHandler
#endstruct

stdim st, UIAutomationPatternInfo        ; NSTRUCT 変数を確保
st->cProperties = 100
mes "cProperties=" + st->cProperties