Jump to content

WinEndEnumWindows

From EDM2
Revision as of 01:27, 9 April 2025 by Martini (talk | contribs) (Created page with "==Syntax== WinEndEnumWindows(henum); ==Parameters== * henum (HENUM) - Input: Enumeration handle. * Returned by previous call to the WinBeginEnumWindows call. ==Returns== ;rc (BOOL) - Returns: Success indicator. :;TRUE ::Successful completion :;FALSE ::Error occurred. ==Remarks== This function destroys the window hierarchy remembered by the WinBeginEnumWindows function. After this function, the ''henum'' parameter is no longer valid. ==Errors== Possib...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Syntax

WinEndEnumWindows(henum);

Parameters

  • henum (HENUM) - Input: Enumeration handle.
   * Returned by previous call to the WinBeginEnumWindows call.

Returns

rc (BOOL) - Returns
Success indicator.
TRUE
Successful completion
FALSE
Error occurred.

Remarks

This function destroys the window hierarchy remembered by the WinBeginEnumWindows function. After this function, the henum parameter is no longer valid.

Errors

Possible returns from WinGetLastError:

PMERR_INVALID_HENUM (0x101C)
An invalid enumeration handle was specified.

Example Code

#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HENUM     henum;                    /* Enumeration handle. */
BOOL      rc;                       /* Success indicator. */

rc = WinEndEnumWindows(henum);

This example ends the child window enumeration and releases the enumeration handle supplied by WinBeginEnumWindows after WinGetNextWindow has enumerated all immediate children of the Desktop.

#define INCL_WINWINDOWMGR       /* Window Manager Functions     */
#include <os2.h>

HWND  hwndParent;       /* Handle of the window whose child windows
                           are to be enumerated                 */
HWND  hwndNext;         /* current enumeration handle           */
HENUM henum;            /* enumeration handle                   */
BOOL  fSuccess;         /* success indicator                    */
SHORT sRetLen;          /* returned string length               */
SHORT sLength = 10;     /* string buffer length                 */
char  pchBuffer[10];    /* string buffer                        */

hwndParent = HWND_DESKTOP;

henum = WinBeginEnumWindows(hwndParent);

while ((hwndNext = WinGetNextWindow(henum)) != NULLHANDLE) {
   /* ... */
}
fSuccess = WinEndEnumWindows(henum);

Related Functions