This example uses WinInitialize to obtain an anchor block and initialize Presentation Manager.

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

HAB     hab;            /* anchor-block handle                  */
HMQ     hmq;            /* message queue handle                 */
QMSG    qmsg;           /* message                              */

hab = WinInitialize(0);          /* initialize PM */

hmq = WinCreateMsgQueue(hab, 0); /* create default size queue */

/*
.
.  initialize windows
.
*/

/* get and dispatch messages from queue */
while (WinGetMsg(hab, &qmsg, 0, 0, 0))
   WinDispatchMsg(hab, &qmsg);


[Back] [Next]