Home > Language Reference > Windows Management Functions > GetWindowName$

GetWindowName$

The GetWindowName$ function returns the name of the window specified by its handle.

Usage

Used to retrieve a window name which can then be used in a UseWindow statement.  

Syntax

var$=GetWindowName$(<handle>)

Parameters

<handle>, integer, window handle.

Return value

var$, string, name of the window. If no window with this <handle> is found, no error is reported and the return value is empty (an empty string is "").

See also

GetFocusWindowHandle
GetTopWindowHandle
GetWindowHandle
UseWindowHandle

Example

shell("notepad.exe")
'Retrieve the handle of the focused window
a=GetFocusWindowHandle()
a$=getwindowname$(a)
msgbox(a$)
'a$ contains the window name of Edit notepad window (the focused one).