WinFind (function)

Syntax

WinFind(name$) As HWND

Description

Returns an object variable referencing the window having the given name.

Comments

The name$ parameter is specified using the same format as that used by the WinActivate statement.

Example

This example closes Microsoft Word if its object reference is found.

Sub Main()

  Dim WordHandle As HWND

  Set WordHandle = WinFind("Word")

  If (WordHandle Is Not Nothing) Then WinClose WordHandle

End Sub

See Also

WinActivate (statement).

More information

W