home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / d / d020_1_4 / 6.ddi / MEMORY / MEMORY2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-01  |  1.6 KB  |  73 lines

  1. #include "windows.h"
  2. #include "memory.h"
  3.  
  4. /****************************************************************************
  5.     MODULE:  memory2.c
  6.  
  7.     FUNCTION: MemoryInit(HANDLE)
  8.  
  9.     PURPOSE: Initializes window data and registers window class
  10.  
  11. ****************************************************************************/
  12.  
  13. BOOL InitApplication(hInstance)
  14. HANDLE hInstance;
  15. {
  16.     WNDCLASS  wc;
  17.  
  18.     wc.style = NULL;
  19.     wc.lpfnWndProc = MainWndProc;
  20.     wc.cbClsExtra = 0;
  21.     wc.cbWndExtra = 0;
  22.     wc.hInstance = hInstance;
  23.     wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  24.     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
  25.     wc.hbrBackground = GetStockObject(WHITE_BRUSH); 
  26.     wc.lpszMenuName =  "MemoryMenu";
  27.     wc.lpszClassName = "MemoryWClass";
  28.  
  29.     return (RegisterClass(&wc));
  30. }
  31.  
  32.  
  33. /****************************************************************************
  34.     MODULE:  memory3.c
  35.  
  36.  
  37.     FUNCTION:  InitInstance(HANDLE, int)
  38.  
  39.     PURPOSE:  Saves instance handle and creates main window
  40.  
  41. ****************************************************************************/
  42.  
  43. BOOL InitInstance(hInstance, nCmdShow)
  44.     HANDLE          hInstance;
  45.     int             nCmdShow;
  46. {
  47.     HWND            hwnd;
  48.  
  49.     hInst = hInstance;
  50.  
  51.     hwnd = CreateWindow(
  52.         "MemoryWClass",
  53.         "Memory Sample Application",
  54.         WS_OVERLAPPEDWINDOW,
  55.         CW_USEDEFAULT,
  56.         CW_USEDEFAULT,
  57.         CW_USEDEFAULT,
  58.         CW_USEDEFAULT,
  59.         NULL,
  60.         NULL,
  61.         hInstance,
  62.         NULL
  63.     );
  64.  
  65.     if (!hwnd)
  66.         return (FALSE);
  67.  
  68.     ShowWindow(hwnd, nCmdShow);
  69.     UpdateWindow(hwnd);
  70.     return (TRUE);
  71.  
  72. }
  73.