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

IUIAutomationTextRange

COM
IIDa543cc6a-f4ae-494b-8239-c814481187a8継承元IUnknown自前メソッド開始 vtbl3

メソッド 18

vtbl = vtable インデックス(0始まり)。HSP等からCOMメソッドをインデックス指定で呼ぶ際に使用します。0〜2 は IUnknown。

vtbl 3 HRESULT Clone(IUIAutomationTextRange** clonedRange)
clonedRangeIUIAutomationTextRange**outこのテキスト範囲と同一の複製を受け取るインターフェイスポインタへのポインタである。
vtbl 4 HRESULT Compare(IUIAutomationTextRange* range, BOOL* areSame)
rangeIUIAutomationTextRange*in比較対象のテキスト範囲へのポインタである。
areSameBOOL*out2 つの範囲が同一かどうかを示す論理値を受け取るポインタである。
vtbl 5 HRESULT CompareEndpoints(TextPatternRangeEndpoint srcEndPoint, IUIAutomationTextRange* range, TextPatternRangeEndpoint targetEndPoint, INT* compValue)
srcEndPointTextPatternRangeEndpointin比較元となるこの範囲の端点(開始または終了)を示す TextPatternRangeEndpoint 値を指定する。
rangeIUIAutomationTextRange*in比較対象のテキスト範囲へのポインタである。
targetEndPointTextPatternRangeEndpointin比較対象範囲の端点(開始または終了)を示す TextPatternRangeEndpoint 値を指定する。
compValueINT*out2 つの端点の前後関係を示す値(負・0・正)を受け取るポインタである。
vtbl 6 HRESULT ExpandToEnclosingUnit(TextUnit textUnit)
textUnitTextUnitin範囲を拡張または収縮させる単位(文字・単語・行など)を示す TextUnit 値を指定する。
vtbl 7 HRESULT FindAttribute(UIA_TEXTATTRIBUTE_ID attr, VARIANT val, BOOL backward, IUIAutomationTextRange** found)
attrUIA_TEXTATTRIBUTE_IDin検索対象のテキスト属性を識別する属性 ID を指定する。
valVARIANTin一致条件とする属性値を格納した VARIANT である。
backwardBOOLin後方(範囲の末尾から先頭)に向けて検索するかどうかを指定する。
foundIUIAutomationTextRange**out指定属性値を持つ最初の部分範囲を受け取るインターフェイスポインタへのポインタである。見つからない場合は NULL が返る。
vtbl 8 HRESULT FindText(LPWSTR text, BOOL backward, BOOL ignoreCase, IUIAutomationTextRange** found)
textLPWSTRin検索する文字列を指定する。
backwardBOOLin後方(範囲の末尾から先頭)に向けて検索するかどうかを指定する。
ignoreCaseBOOLin大文字と小文字を区別しないで検索するかどうかを指定する。
foundIUIAutomationTextRange**outテキストが見つかった部分範囲を受け取るインターフェイスポインタへのポインタである。見つからない場合は NULL が返る。
vtbl 9 HRESULT GetAttributeValue(UIA_TEXTATTRIBUTE_ID attr, VARIANT* value)
attrUIA_TEXTATTRIBUTE_IDin値を取得するテキスト属性を識別する属性 ID を指定する。
valueVARIANT*out取得した属性値を格納する VARIANT へのポインタである。
vtbl 10 HRESULT GetBoundingRectangles(SAFEARRAY** boundingRects)
boundingRectsSAFEARRAY**out範囲の各行の外接矩形(left, top, width, height の並び)を格納した SAFEARRAY を受け取るポインタへのポインタである。
vtbl 11 HRESULT GetEnclosingElement(IUIAutomationElement** enclosingElement)
enclosingElementIUIAutomationElement**outこのテキスト範囲を内包する最も内側の要素を受け取るインターフェイスポインタへのポインタである。
vtbl 12 HRESULT GetText(INT maxLength, LPWSTR* text)
maxLengthINTin取得する最大文字数を指定する。-1 を指定すると範囲内の全テキストを取得する。
textLPWSTR*out取得したテキスト文字列を受け取る文字列ポインタへのポインタである。
vtbl 13 HRESULT Move(TextUnit unit, INT count, INT* moved)
unitTextUnitin範囲を移動させる単位を示す TextUnit 値を指定する。
countINTin移動する単位数を指定する。負の値で後方へ移動する。
movedINT*out実際に移動した単位数を受け取るポインタである。
vtbl 14 HRESULT MoveEndpointByUnit(TextPatternRangeEndpoint endpoint, TextUnit unit, INT count, INT* moved)
endpointTextPatternRangeEndpointin移動させる端点(開始または終了)を示す TextPatternRangeEndpoint 値を指定する。
unitTextUnitin端点を移動させる単位を示す TextUnit 値を指定する。
countINTin移動する単位数を指定する。負の値で後方へ移動する。
movedINT*out実際に移動した単位数を受け取るポインタである。
vtbl 15 HRESULT MoveEndpointByRange(TextPatternRangeEndpoint srcEndPoint, IUIAutomationTextRange* range, TextPatternRangeEndpoint targetEndPoint)
srcEndPointTextPatternRangeEndpointin移動させるこの範囲の端点(開始または終了)を示す TextPatternRangeEndpoint 値を指定する。
rangeIUIAutomationTextRange*in移動先の基準となるテキスト範囲へのポインタである。
targetEndPointTextPatternRangeEndpointin移動先の基準範囲のどの端点に合わせるかを示す TextPatternRangeEndpoint 値を指定する。
vtbl 16 HRESULT Select()
vtbl 17 HRESULT AddToSelection()
vtbl 18 HRESULT RemoveFromSelection()
vtbl 19 HRESULT ScrollIntoView(BOOL alignToTop)
alignToTopBOOLin範囲を表示領域の上端に揃えるか(TRUE)、下端に揃えるか(FALSE)を指定する。
vtbl 20 HRESULT GetChildren(IUIAutomationElementArray** children)
childrenIUIAutomationElementArray**outこのテキスト範囲に含まれる子要素の集合を受け取る IUIAutomationElementArray へのポインタへのポインタである。

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"

出力引数:
#define global IID_IUIAutomationTextRange "{A543CC6A-F4AE-494B-8239-C814481187A8}"
#usecom global IUIAutomationTextRange IID_IUIAutomationTextRange "{}"
#comfunc global IUIAutomationTextRange_Clone                  3 sptr
#comfunc global IUIAutomationTextRange_Compare                4 sptr,var
#comfunc global IUIAutomationTextRange_CompareEndpoints       5 int,sptr,int,var
#comfunc global IUIAutomationTextRange_ExpandToEnclosingUnit  6 int
#comfunc global IUIAutomationTextRange_FindAttribute          7 int,int,int,sptr
#comfunc global IUIAutomationTextRange_FindText               8 wstr,int,int,sptr
#comfunc global IUIAutomationTextRange_GetAttributeValue      9 int,var
#comfunc global IUIAutomationTextRange_GetBoundingRectangles  10 var
#comfunc global IUIAutomationTextRange_GetEnclosingElement    11 sptr
#comfunc global IUIAutomationTextRange_GetText                12 int,var
#comfunc global IUIAutomationTextRange_Move                   13 int,int,var
#comfunc global IUIAutomationTextRange_MoveEndpointByUnit     14 int,int,int,var
#comfunc global IUIAutomationTextRange_MoveEndpointByRange    15 int,sptr,int
#comfunc global IUIAutomationTextRange_Select                 16
#comfunc global IUIAutomationTextRange_AddToSelection         17
#comfunc global IUIAutomationTextRange_RemoveFromSelection    18
#comfunc global IUIAutomationTextRange_ScrollIntoView         19 int
#comfunc global IUIAutomationTextRange_GetChildren            20 sptr
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。