共用方式為


FindWindow 搜尋路徑標記

 

發行︰ 2016年11月

適用於: Dynamics 365 (online)、Dynamics 365 (on-premises)、Dynamics CRM 2013、Dynamics CRM 2015、Dynamics CRM 2016

<FindWindow> 標記包含相符元素的清單,依元素在標記中的列出順序執行元素。 本主題使用範例程式碼說明 <FindWindow> 元素。

本主題內容

<FindWindow> 元素

範例指令碼

<FindWindow> 元素

下列程式碼片段顯示 <FindWindow> 標記中的元素

# RELAX NG XML grammar for FindWindow 
# http://relaxng.org/compact-tutorial-20030326.html 
Grammar
{ 
start = FindWindow FindWindow = element 
FindWindow
{ 
  element ControlId { attribute match { xsd:integer }?, text }*
& element Caption { attribute match { xsd:integer }?, text }*
& element CaptionStartsWith { same as Caption }*
& element CaptionEndsWith { same as Caption }*
& element CaptionContains { same as Caption }*
& element Class { attribute match { xsd:integer }?, text }*
& element ClassStartsWith { same as Class }*
& element ClassEndsWith { same as Class }*
& element ClassContains { same as Class }*
& element Position { xsd:integer, xsd:integer } *
& element Find { Caption & Class }*
& element Desktop { empty }*
& element Application { empty }*
& element Owner { empty }*
& element RelaxProcessIdRestriction { empty }*
& element RelaxThreadIdRestriction { empty }*
}
} 

下表描述 <FindWinow> 元素。

項目

描述

ControlId

使用識別碼的視窗

Caption

視窗標題文字。

CaptionStartsWith

標題開頭文字

CaptionEndsWith

標題結尾文字。

CaptionContains

標題包含文字。

Class

使用類別名稱的視窗

ClassStartsWith

類別名稱開頭文字。

ClassEndsWith

類別名稱結尾文字。

ClassContains

類別包含文字。

Position

在指定的位置搜尋視窗。 位置定義為視窗的左上角,(x,y) 座標。 位置是從 <Application/> (預設) 或從 <Desktop/> 計算。 如果使用 <Desktop/>,必須在 <Position> 元素之前指定它。

尋找

搜尋透過 ClassCaption 元素指定的視窗。FindWindow 相同的元素可以在此處使用 (CaptionCaptionStartsWithCaptionEndsWithCaptionContainsClassClassStartsWithClassEndsWithClassContains)。

Desktop

設定搜尋點為桌面

Application

設定搜尋點為應用程式的最上層視窗。

Owner

具有指定的負責人的視窗。

RelaxProcessIdRestriction

在搜尋中包含不同程序識別碼的視窗。 根據預設,所有視窗屬於相同程序識別碼。

RelaxThreadIdRestriction

在搜尋程序中包含不同執行緒識別碼的視窗。 根據預設,所有視窗屬於相同執行緒識別碼。

範例指令碼

下列一組範例顯示如何使用不同屬性。

The following sample searches for a window with the control ID 1003.
<FindWindow>
<ControlID>1003</ControlID>
</FindWindow>

The following sample searches for a window with the class name SunAWTFrame.
<FindWindow>
<Class>SunAWTFrame</Class>
</FindWindow>

The following sample searches for a window at desktop position x200 y400. 
<FindWindow>
<Desktop/>
<Position>200,400</Position>
</FindWindow>

The following sample searches for the second application with the caption CurrencyConv that is not within the same process as the DDA loaded application. 

<FindWindow>
<RelaxProcessIdRestriction/>
<Caption match="2">CurrencyConv</Caption>
</FindWindow>

另請參閱

JavaDDA
使用資料驅動型配接器 (DDA)

Unified Service Desk 2.0

© 2017 Microsoft. 著作權所有,並保留一切權利。 著作權