This example finds the handles of all frame controls of a specified window via the WinMultWindowFromIDs call. The handles are returned in an array of window handles, and after the call completes, the handle for the minmax control window is assigned to a variable if a handle for it was found (i.e. handle not equal to NULLHANDLE).
#define INCL_WINWINDOWMGR /* Window Manager Functions */ #define INCL_WINFRAMEMGR /* Window Frame Functions */ #include <os2.h> HWND hwndParent; /* parent window */ HWND ahwnd[FID_CLIENT-FID_SYSMENU]; /* window handle array */ HWND hwndMinMax; /* minmax control window handle */ LONG lHandles; /* number of handles returned */ /* get all control handles between and including system menu and client windows */ lHandles = WinMultWindowFromIDs(hwndParent, ahwnd, FID_SYSMENU, FID_CLIENT); /* if any handles returned and the handle for the minmax control is not null, assign a variable to the minmax handle */ if (lHandles > 0 && ahwnd[FID_MINMAX - FID_SYSMENU] != NULLHANDLE) hwndMinMax = ahwnd[FID_MINMAX - FID_SYSMENU];