Пример #1
0
//
//   FUNCTION: InitInstance(HINSTANCE, 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.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   HWND hWnd;

   hInst = hInstance; // Store instance handle in our global variable

#if defined(ZOOM) && defined(SECOND_SCREEN)
   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
	1920 + 0, 0, 1920, 1000, NULL, NULL, hInstance, NULL);
#elif defined(ZOOM) && !defined(SECOND_SCREEN)
    hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      0, 0, 1920, 1000, NULL, NULL, hInstance, NULL);
#elif !defined(ZOOM) && defined(SECOND_SCREEN)
    hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      1920 + 296, 266, 1296, 538, NULL, NULL, hInstance, NULL);
#else
    hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      296, 266, 1296, 538, NULL, NULL, hInstance, NULL);
#endif

   if (!hWnd)
   {
      return FALSE;
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   // Run the Pi tests
   Tests tests;
   tests.RunAllTests();

  // while(1);

   LoadFontResource(&gFontErasDemi18, "Eras Demi ITC.bin");
   LoadImageResource(&gWaterTempImage, "..\\..\\bitmaps\\Water.bmp");
   LoadImageResource(&gFuelImage, "..\\..\\bitmaps\\Fuel.bmp");
   LoadImageResource(&gCarTopView, "..\\..\\bitmaps\\CamaroGrey.bmp");
   LoadImageResource(&gLeftArrowImage, "..\\..\\bitmaps\\LeftArrow.bmp");
   LoadImageResource(&gRightArrowImage, "..\\..\\bitmaps\\RightArrow.bmp");
   
   Rect rect(0, 0, 1280, 480);
   gCluster.Init(rect);
   gFontDB.CreateFontDatabase("Eras Demi ITC", 18);

   return TRUE;
}