home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / os2sdk / os2sdk11 / petzold / chap02 / welco.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-20  |  1.4 KB  |  39 lines

  1. /*------------------------------------------
  2.    WELCO.C -- A Program with a Message Loop
  3.   ------------------------------------------*/
  4.  
  5. #include <os2.h>
  6.  
  7. int main (void)
  8.      {
  9.      static ULONG flFrameFlags = FCF_TITLEBAR      | FCF_SYSMENU |
  10.                                  FCF_SIZEBORDER    | FCF_MINMAX  |
  11.                                  FCF_SHELLPOSITION | FCF_TASKLIST ;
  12.      HAB          hab ;
  13.      HMQ          hmq ;
  14.      HWND         hwndFrame ;
  15.      QMSG         qmsg ;
  16.  
  17.      hab = WinInitialize (0) ;
  18.      hmq = WinCreateMsgQueue (hab, 0) ;
  19.  
  20.      hwndFrame = WinCreateStdWindow (
  21.                     HWND_DESKTOP,       // Parent window handle
  22.                     WS_VISIBLE,         // Style of frame window
  23.                     &flFrameFlags,      // Pointer to control data
  24.                     NULL,               // Client window class name
  25.                     NULL,               // Title bar text
  26.                     0L,                 // Style of client window
  27.                     NULL,               // Module handle for resources
  28.                     0,                  // ID of resources
  29.                     NULL) ;             // Pointer to client window handle
  30.  
  31.      while (WinGetMsg (hab, &qmsg, NULL, 0, 0))
  32.           WinDispatchMsg (hab, &qmsg) ;
  33.  
  34.      WinDestroyWindow (hwndFrame) ;
  35.      WinDestroyMsgQueue (hmq) ;
  36.      WinTerminate (hab) ;
  37.      return 0 ;
  38.      }
  39.