home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / EN0719.ZIP / PMHELLO.C < prev    next >
C/C++ Source or Header  |  1988-07-18  |  1KB  |  37 lines

  1. /*----------------------------------------------------------------
  2.    PMHELLO.C -- OS/2 PM "Hello, world" Program -- main() Function
  3.                 (c) 1988, Ziff Communications Company
  4.                 PC Magazine * Charles Petzold, 7/88
  5.   ----------------------------------------------------------------*/
  6.  
  7. #include <os2.h>
  8.  
  9. MRESULT EXPENTRY ClientWndProc (HWND, USHORT, MPARAM, MPARAM) ;
  10.  
  11. int main (void)
  12.      {
  13.      static CHAR szClientClass [] = "PMHello" ;
  14.      HAB         hab ;
  15.      HMQ         hmq ;
  16.      HWND        hwndFrame, hwndClient ;
  17.      QMSG        qmsg ;
  18.      ULONG       flFrameFlags = FCF_STANDARD & ~FCF_MENU ;
  19.  
  20.      hab = WinInitialize (0) ;
  21.      hmq = WinCreateMsgQueue (hab, 0) ;
  22.      WinRegisterClass (hab, szClientClass, ClientWndProc, CS_SIZEREDRAW, 0) ;
  23.  
  24.      hwndFrame = WinCreateStdWindow (HWND_DESKTOP, WS_VISIBLE,
  25.                                      &flFrameFlags, szClientClass,
  26.                                      "OS/2 PM \"Hello, world\" Program",
  27.                                      0L, NULL, 0, &hwndClient) ;
  28.  
  29.      while (WinGetMsg (hab, &qmsg, NULL, 0, 0))
  30.           WinDispatchMsg (hab, &qmsg) ;
  31.  
  32.      WinDestroyWindow (hwndFrame) ;
  33.      WinDestroyMsgQueue (hmq) ;
  34.      WinTerminate (hab) ;
  35.      return 0 ;
  36.      }
  37.