Annotation of pmsdk/samples/petzold/chap02/welcom.c, revision 1.1.1.1

1.1       root        1: /*----------------------------------------------------
                      2:    WELCOM.C -- A Program that Creates a Client Window
                      3:   ----------------------------------------------------*/
                      4: 
                      5: #include <os2.h>
                      6: 
                      7: MRESULT EXPENTRY ClientWndProc (HWND, USHORT, MPARAM, MPARAM) ;
                      8: 
                      9: int main (void)
                     10:      {
                     11:      static CHAR szClientClass [] = "Welcom" ;
                     12:      HAB         hab ;
                     13:      HMQ         hmq ;
                     14:      HWND        hwndFrame, hwndClient ;
                     15:      QMSG        qmsg ;
                     16:      ULONG       flFrameFlags = FCF_STANDARD & ~FCF_MENU ;
                     17:      ULONG       flFrameStyle = WS_VISIBLE ;
                     18: 
                     19:      hab = WinInitialize (0) ;
                     20:      hmq = WinCreateMsgQueue (hab, 0) ;
                     21: 
                     22:      WinRegisterClass (
                     23:                     hab,                /* Anchor block handle             */
                     24:                    szClientClass,      /* Name of class being registered  */
                     25:                     ClientWndProc,      /* Window procedure for class      */
                     26:                     0L,                 /* Class style                     */
                     27:                     0) ;                /* Extra bytes to reserve          */
                     28: 
                     29:      hwndFrame = WinCreateStdWindow (
                     30:                     HWND_DESKTOP,       /* Parent window handle            */
                     31:                     flFrameStyle,       /* Style of frame window           */
                     32:                    &flFrameFlags,      /* Pointer to control data         */
                     33:                    szClientClass,      /* Client window class name        */
                     34:                     "WELCOM Program",   /* Title bar text                  */
                     35:                     0L,                 /* Style of client window          */
                     36:                     NULL,               /* Module handle for resources     */
                     37:                     0,                  /* ID of resources                 */
                     38:                     &hwndClient) ;      /* Pointer to client window handle */
                     39: 
                     40:      while (WinGetMsg (hab, &qmsg, NULL, 0, 0))
                     41:           WinDispatchMsg (hab, &qmsg) ;
                     42: 
                     43:      WinDestroyWindow (hwndFrame) ;
                     44:      WinDestroyMsgQueue (hmq) ;
                     45:      WinTerminate (hab) ;
                     46: 
                     47:      return 0 ;
                     48:      }
                     49: 
                     50: MRESULT EXPENTRY ClientWndProc (HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2)
                     51:      {
                     52:      return WinDefWindowProc (hwnd, msg, mp1, mp2) ;
                     53:      }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.