Stores window handles (HWND's) into an array.
AWindows(cArrayName, nType [, nParam])
Parameters
- cArrayName
On return the array contains the following information. Column Content Datatype 1 A window handle (HWND). N
- nType (additive)
One of the following values.
Type Description AWINDOWS_TOPLEVEL Returns top level windows. AWINDOWS_CHILD Returns child windows of the window passed in nParam. AWINDOWS_THREAD Returns windows owned by the thread passed in nParam. AWINDOWS_DESKTOP Returns windows contained in the desktop passed in nParam. AWINDOWS_CALLBACK Interpret first paramter as callback function (additive to the above).
- nParam
Depending on the nType parameter this parameter should be on of the following values.
Type Meaning of this parameter AWINDOWS_TOPLEVEL Don't pass this parameter. AWINDOWS_CHILD A window handle for which to retrieve the child windows. AWINDOWS_THREAD A thread handle for which to retrieve the owned windows. AWINDOWS_DESKTOP A 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:
AWindows('laArray',1)
Enumerate toplevel windows by calling SomeFunction with hHwnd parameter for each window found:
AWindows('SomeFunction',1+16)
Enumerate child windows of _SCREEN:
AWindows('laArray',2,_SCREEN.hWnd)
Enumerate windows of a thread:
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