Stores window handles (HWND's) into an array.

AWindows(cArrayName, nType [, nParam])

Parameters

cArrayName
On return the array contains the following information.
ColumnContentDatatype
1A window handle (HWND).N
nType (additive)

One of the following values.

TypeDescription
AWINDOWS_TOPLEVELReturns top level windows.
AWINDOWS_CHILDReturns child windows of the window passed in nParam.
AWINDOWS_THREADReturns windows owned by the thread passed in nParam.
AWINDOWS_DESKTOPReturns windows contained in the desktop passed in nParam.
AWINDOWS_CALLBACKInterpret first paramter as callback function (additive to the above).
nParam

Depending on the nType parameter this parameter should be on of the following values.

TypeMeaning of this parameter
AWINDOWS_TOPLEVELDon't pass this parameter.
AWINDOWS_CHILDA window handle for which to retrieve the child windows.
AWINDOWS_THREADA thread handle for which to retrieve the owned windows.
AWINDOWS_DESKTOPA desktop handle for which to retrieve the contained windows.

Return Value

If nType contains AWINDOWS_CALLBACK 1 is returned, otherwise the number of windows.

Example

Enumerate toplevel windows into an array:

Copy code
AWindows('laArray',1)

Enumerate toplevel windows by calling SomeFunction with hHwnd parameter for each window found:

Copy code
AWindows('SomeFunction',1+16)

Enumerate child windows of _SCREEN:

Copy code
AWindows('laArray',2,_SCREEN.hWnd)

Enumerate windows of a thread:

Copy code
AWindows('laArray',4,_VFP.ThreadId)

See Also

Reference

AWindowProps
AWindowsEx
CenterWindowEx
GetWindowRectEx
GetWindowTextEx

Used WinApi functions

EnumWindows if nType = AWINDOWS_TOPLEVEL
EnumChildWindows if nType = AWINDOWS_CHILD
EnumThreadWindows if nType = AWINDOWS_THREAD
EnumDesktopWindows if nType = AWINDOWS_DESKTOP