main.cpp
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   hInst = hInstance; // Store instance handle in our global variable

   RECT windowRect{};
   windowRect.right = 640;
   windowRect.bottom = 448;
   AdjustWindowRect(&windowRect, WS_OVERLAPPEDWINDOW, FALSE);

   hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, NULL, NULL, hInstance, NULL);

   if (!hMainWnd)
   {
	   return FALSE;
   }

   ShowWindow(hMainWnd, nCmdShow);
   UpdateWindow(hMainWnd);

   // Create DirectDraw and its objects
   DirectDrawInit();
   graphicsLoaded = true;

   return TRUE;
}
//
//   FUNCTION: InitInstance(HANDLE, int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function, we save the instance handle in a global variable and
//        create and display the main program window.
//
InitInstance(HANDLE, int)
PURPOSE: Saves instance handle and creates main window



In this function, we save the instance handle in a global variable and
create and display the main program window.
InitInstance ( HANDLE int ) PURPOSE : Saves instance handle and creates main window In this function we save the instance handle in a global variable and create and display the main program window .
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   hInst = hInstance; 
   RECT windowRect{};
   windowRect.right = 640;
   windowRect.bottom = 448;
   AdjustWindowRect(&windowRect, WS_OVERLAPPEDWINDOW, FALSE);
   hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, NULL, NULL, hInstance, NULL);
   if (!hMainWnd)
   {
	   return FALSE;
   }
   ShowWindow(hMainWnd, nCmdShow);
   UpdateWindow(hMainWnd);
   DirectDrawInit();
   graphicsLoaded = true;
   return TRUE;
}
BOOL InitInstance ( HINSTANCE hInstance , int nCmdShow ) { hInst = hInstance ; RECT windowRect { } ; windowRect . right = 640 ; windowRect . bottom = 448 ; AdjustWindowRect ( & windowRect , WS_OVERLAPPEDWINDOW , FALSE ) ; hMainWnd = CreateWindow ( szWindowClass , szTitle , WS_OVERLAPPEDWINDOW , CW_USEDEFAULT , 0 , windowRect . right - windowRect . left , windowRect . bottom - windowRect . top , NULL , NULL , hInstance , NULL ) ; if ( ! hMainWnd ) { return FALSE ; } ShowWindow ( hMainWnd , nCmdShow ) ; UpdateWindow ( hMainWnd ) ; DirectDrawInit ( ) ; graphicsLoaded = true ; return TRUE ; }
FUNCTION: InitInstance(HANDLE, int)
PURPOSE: Saves instance handle and creates main window
FUNCTION : InitInstance ( HANDLE int ) PURPOSE : Saves instance handle and creates main window
// Store instance handle in our global variable // Create DirectDraw and its objects