WindowIsOfClass Function


Determines if a particular window is of a particular class.


bTest = WindowIsOfClass (wWindow, dMatchClass [,bExactMatch])
Variable Description
bTest Returns TRUE if the specified wWindow is of the class dMatchClass. BOOLEAN.
wWindow The window of interest. WINDOW.
dMatchClass The AnyWin class for which you are testing. DATACLASS.
bExactMatch Optional. If set to TRUE, WindowIsOfClass returns TRUE when dClass is exactly the same as the object’s class. If set to FALSE or omitted, WindowIsOfClass returns TRUE when dClass is either a parent of the object’s class or matches exactly. BOOLEAN.


Use WindowIsOfClass to test whether a variable of type WINDOW holds a window of a particular class. In the example below, if the active window returned to wWin is of MessageBoxClass, WindowIsOfClass will return TRUE. WindowIsOfClass is the function equivalent of the IsOfClass method.


[ ] // in declarations
[-] window MessageBoxClass MessageBox
	[ ] tag "~ActiveApp/[DialogBox]$MessageBox" 
	[ ] ... 
[-] window DialogBox Find
	[ ] tag "Find"
	[ ] parent NotePad
	[ ] ...  
[-] WINDOW wInvoke = NotePad.Search.Find
	[ ] ... 
[ ] 
[ ] // in test case script
[ ] WINDOW wWin = NotePad.GetActive () 
[ ] 
[ ] DATACLASS dClass = MessageBoxClass
[ ] BOOLEAN bExact = TRUE
[ ] BOOLEAN bTest = WindowIsOfClass (wWin, dClass, bExact)