This function creates a secondary window from a dialog template in memory.
#define INCL_SW
#include <os2.h>
HWND hwndParent; /* Parent window handle. */
HWND hwndOwner; /* Window-handle owner. */
PFNWP pfnDlgProc; /* Secondary window procedure. */
PDLGTEMPLATE pdlgt; /* Dialog template. */
PVOID pCreateParams; /* Parameters passed to secondary window proc. */
HWND hwnd; /* Window handle. */
hwnd = WinCreateSecondaryWindow(hwndParent,
hwndOwner, pfnDlgProc, pdlgt, pCreateParams);