home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / lan / wbtrex.arj / INIT.C < prev    next >
Text File  |  1979-12-31  |  2KB  |  59 lines

  1. /***************************************************************************/
  2. /*                             T E A M - E D                               */
  3. /***************************************************************************/
  4. /*                                                                         */
  5. /* INIT.c                                                                  */
  6. /*                                                                         */
  7. /*   Initialization routine for sample MS-Windows application              */
  8. /*                                                                         */
  9. /***************************************************************************/
  10. /***************************************************************************/
  11. #include <windows.h>
  12. #include "sample.h"
  13. #include "extern.h"
  14.  
  15.  
  16. extern long far pascal WndProc (HWND, unsigned, WORD, LONG);
  17.  
  18. int initSample (HANDLE, HANDLE, int);
  19. int initSample (HANDLE hInstance, HANDLE hPrevInstance, int nCmdShow)
  20. {
  21.     WNDCLASS    wndclass;
  22.     static char szAppName[] = "SAMPLE";
  23.  
  24.     if (!hPrevInstance)
  25.     {
  26.        wndclass.style            = CS_HREDRAW | CS_VREDRAW;
  27.        wndclass.lpfnWndProc      = WndProc;
  28.        wndclass.cbClsExtra       = 0;
  29.        wndclass.cbWndExtra       = 0;
  30.        wndclass.hInstance        = hInstance;
  31.        wndclass.hIcon            = LoadIcon (hInstance, "SAMPLEICON");
  32.        wndclass.hCursor          = LoadCursor (NULL, IDC_ARROW);
  33.        wndclass.hbrBackground    = GetStockObject (WHITE_BRUSH);
  34.        wndclass.lpszMenuName     = szAppName;
  35.        wndclass.lpszClassName    = szAppName;
  36.  
  37.        if (!RegisterClass (&wndclass))
  38.           return (FALSE);
  39.      }
  40.  
  41.      parentWnd = CreateWindow (szAppName,
  42.                               " Generic Skeleton ",
  43.                               WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL,
  44.                               CW_USEDEFAULT, 0,
  45.                               CW_USEDEFAULT, 0,
  46.                               NULL, NULL,
  47.                               hInstance,
  48.                               NULL);
  49.  
  50.      if (!parentWnd)
  51.         return (FALSE);
  52.  
  53.      parentInst = hInstance;
  54.      ShowWindow (parentWnd, nCmdShow);
  55.      UpdateWindow (parentWnd);
  56.  
  57.      return (TRUE);
  58. }
  59.