WinEndEnumWindow: Difference between revisions
Appearance
Created page with "This function ''ends the enumeration process for a specified enumeration''. ==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..." |
No edit summary |
||
| Line 17: | Line 17: | ||
==Remarks== | ==Remarks== | ||
This function destroys the window hierarchy remembered by the [[WinBeginEnumWindows]] function. After this function, the | This function destroys the window hierarchy remembered by the [[WinBeginEnumWindows]] function. After this function, the henum parameter is no longer valid. | ||
==Errors== | ==Errors== | ||
Latest revision as of 16:23, 9 April 2025
This function ends the enumeration process for a specified enumeration.
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 fSuccess; /* Success indicator. */ henum = WinBeginEnumWindows(HWND_DESKTOP); // ... enumeration using WinGetNextWindow ... fSuccess = 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) {
// Process each child window (hwndNext)
}
fSuccess = WinEndEnumWindows (henum);