home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ENV719.ZIP / PMHELLO1.C < prev    next >
C/C++ Source or Header  |  1988-07-18  |  966b  |  29 lines

  1. /*---------------------------------------------------------------------
  2.    PMHELLO1.C -- OS/2 PM "Hello, world" Program -- Window Procedure #1
  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 hwnd, USHORT msg, MPARAM mp1, MPARAM mp2)
  10.      {
  11.      HPS   hps ;
  12.      RECTL rcl ;
  13.  
  14.      switch (msg)
  15.       {
  16.           case WM_PAINT:
  17.                hps = WinBeginPaint (hwnd, NULL, NULL) ;
  18.  
  19.                WinQueryWindowRect (hwnd, &rcl) ;
  20.                WinDrawText (hps, -1, "Hello, world", &rcl,
  21.                             CLR_NEUTRAL, CLR_BACKGROUND,
  22.                             DT_CENTER | DT_VCENTER | DT_ERASERECT) ;
  23.  
  24.                WinEndPaint (hps) ;
  25.                return 0 ;
  26.           }
  27.      return WinDefWindowProc (hwnd, msg, mp1, mp2) ;
  28.      }
  29.