This example creates a list box window named "List Box" as a child of the desktop located at (0,0), of size 200x100.
#define INCL_WINWINDOWMGR /* Window Manager Functions */ #define INCL_WINLISTBOXES /* List Box definitions */ #include <os2.h> HWND hwnd; /* Cursor display window */ ULONG ListBoxId; /* Window id */ /* (supplied by application) */ ULONG flStyle; /* Window style */ flStyle = WS_VISIBLE; /* Create window visible */ /* Create button window */ hwnd = WinCreateWindow(HWND_DESKTOP, /* Parent window */ WC_LISTBOX, /* Class name */ "List Box", /* Window text */ flStyle, /* Window style */ 0, 0, /* Position (x,y) */ 200, 100, /* Size (width,height) */ NULLHANDLE, /* Owner window */ HWND_TOP, /* Sibling window */ ListBoxId, /* Window id */ NULL, /* Control data */ NULL); /* Pres parameters */