FindWindowContaining Example

 

The following example tries to find a window that contains the text ôAccess violation.ö If a window is found, a message box is displayed with the text ôWindow found.ö Otherwise, a message box with the text ôWindow NOT foundö is displayed.

 

Sub Main

 If AutoMate2.FindWindowContaining (ôAccess violationö) > 0

  MsgBox ôWindow foundö

 Else

  MsgBox ôWindow NOT foundö

 End If

End Sub