FindWindowContaining Method

AutoMate Example

 

Returns the handle of the window that contains a specified text.

Declaration

Function FindWindowContaining (TextToFind As Variant) As Integer

 

Description

Use FindWindowContaining to obtain a handle to the window that contains the text specified by TextToFind. The window must be open for this method to be successful. If multiple windows containing the specified text are open, the method will return the handle to the first window it finds. The method returns “0” if there are no windows with the text, or it returns a non-zero value (the window handle) if the window is located.