FindWindow

Description:

baFindWindow returns the handle of a window. This handle can then be used in other window management functions.

Platforms:

Windows and Macintosh

Usage:

Result = baFindWindow( Class/Creator, Title )

Arguments:

String, string.
On Windows, Class is the class name of the window.
On Macintosh, Creator it is the creator type of the application.
Title is the text in the window's caption.
The function can use either or both arguments. If one of the arguments is blank, then only the other argument will be used in searching for the window.

Returns:

Integer.
Returns the window handle. If the window isn't found, then returns 0.

Examples:

Director:
WinHandle = baFindWindow( "" , "Calculator" )

Authorware:
WinHandle := baFindWindow( "" , "Calculator" )
 

Notes:

On Windows, a window handle is an number that Windows uses to identify windows. Every window has a unique handle. You can use this handle to manipulate the window; bring it to the front, close it, etc. Every window also has a class name. This is assigned by the programmer, and can be used to find a specific window. For example, the Class window for the main MS Word window is "OpusApp". To find the handle for the Word window, you could use FindWindow( "OpusApp", "" ).

If you know the text in the window's caption, you can use this to find the window. For example, FindWindow( "" , "Notepad mydoc.txt" ).

On Macintosh, the window handle returned is the identifier for the application rather than an individual window. The title of the window will be the name that appears in the Application menu.
 

See also:

baWindowList
baGetWindow