home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / SAMPLES / CDDEMO / INIT.C_ / INIT.C
Encoding:
C/C++ Source or Header  |  1993-02-08  |  2.0 KB  |  52 lines

  1. /**************************************************************************
  2. *                                                                         *
  3. *      File:  INIT.C                                                      *
  4. *                                                                         *
  5. *   Purpose:  Contains the code to create and show the window for each    *
  6. *             instance of the app.                                        *
  7. *                                                                         *
  8. * Functions:  BOOL InitInstance(HANDLE, int)                              *
  9. *                                                                         *
  10. *  Comments:                                                              *
  11. *                                                                         *
  12. *   History:  Date      Reason                                            *
  13. *             --------  -----------------------------------               *
  14. *                                                                         *
  15. *             10/01/91  Created                                           *
  16. *                                                                         *
  17. **************************************************************************/
  18.  
  19. #define WIN31
  20.  
  21. #include "windows.h"
  22. #include "commdlg.h"
  23. #pragma hdrstop
  24. #define ININIT
  25. #include "cddemo.h"
  26. #undef  ININIT
  27.  
  28. BOOL FAR InitInstance(HANDLE hInstance, int nCmdShow)
  29. {
  30.   ghInst = hInstance;
  31.  
  32.   ghWnd = CreateWindow(gszCommonWClass,
  33.                        gszAppName,
  34.                        WS_OVERLAPPEDWINDOW,
  35.                        CW_USEDEFAULT,
  36.                        nCmdShow,
  37.                        CW_USEDEFAULT,
  38.                        CW_USEDEFAULT,
  39.                        NULL,
  40.                        NULL,
  41.                        hInstance,
  42.                        NULL);
  43.  
  44.   if (!ghWnd)
  45.      return(FALSE);
  46.  
  47.   ShowWindow(ghWnd, nCmdShow);
  48.   UpdateWindow(ghWnd);
  49.  
  50.   return(TRUE);
  51. }
  52.