home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / COMMON / TOOLS / VCM / VCM.MDB / VcmComponentContainer / 20_Cabinet / WIZARD97.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-18  |  3.1 KB  |  115 lines

  1. // Wizard97.cpp : Defines the class behaviors for the application.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "Wizard97.h"
  15. #include "WizSheet.h"
  16.  
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CWizard97App
  25.  
  26. BEGIN_MESSAGE_MAP(CWizard97App, CWinApp)
  27.     //{{AFX_MSG_MAP(CWizard97App)
  28.         // NOTE - the ClassWizard will add and remove mapping macros here.
  29.         //    DO NOT EDIT what you see in these blocks of generated code!
  30.     //}}AFX_MSG
  31.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  32. END_MESSAGE_MAP()
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CWizard97App construction
  36.  
  37. CWizard97App::CWizard97App()
  38. {
  39.     // TODO: add construction code here,
  40.     // Place all significant initialization in InitInstance
  41. }
  42.  
  43. /////////////////////////////////////////////////////////////////////////////
  44. // The one and only CWizard97App object
  45.  
  46. CWizard97App theApp;
  47.  
  48. static BOOL Is256ColorSupported()
  49. {
  50.     BOOL bRetval = FALSE;
  51.  
  52.     // return TRUE if screen deivce supports 256 colors or better
  53.  
  54.     HDC hdc = GetDC(NULL);
  55.     if (hdc != NULL)
  56.     {
  57.         if(GetDeviceCaps(hdc, BITSPIXEL) >= 8)
  58.             bRetval = TRUE;
  59.         ReleaseDC(NULL, hdc);
  60.     }
  61.  
  62.     return bRetval;
  63. }
  64.  
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67. // CWizard97App initialization
  68.  
  69. BOOL CWizard97App::InitInstance()
  70. {
  71.     // Standard initialization
  72.     // If you are not using these features and wish to reduce the size
  73.     //  of your final executable, you should remove from the following
  74.     //  the specific initialization routines you do not need.
  75.  
  76. #ifdef _AFXDLL
  77.     Enable3dControls();         // Call this when using MFC in a shared DLL
  78. #else
  79.     Enable3dControlsStatic();   // Call this when linking to MFC statically
  80. #endif
  81.  
  82.     CBitmap bmpWatermark;
  83.     CBitmap bmpHeader;
  84.  
  85.     if (Is256ColorSupported())
  86.     {
  87.         VERIFY(bmpWatermark.LoadBitmap(IDB_WATERMARK256));
  88.         VERIFY(bmpHeader.LoadBitmap(IDB_BANNER256));
  89.     }
  90.     else
  91.     {
  92.         VERIFY(bmpWatermark.LoadBitmap(IDB_WATERMARK16));
  93.         VERIFY(bmpHeader.LoadBitmap(IDB_BANNER16));
  94.     }
  95.  
  96.     CWizard97Sheet dlg(IDS_SAMPLEWIZARD, NULL, 0, bmpWatermark, NULL, bmpHeader);
  97.     dlg.m_psh.hInstance = ::GetModuleHandle(NULL);
  98.     m_pMainWnd = &dlg;
  99.     int nResponse = dlg.DoModal();
  100.     if (nResponse == IDOK)
  101.     {
  102.         // TODO: Place code here to handle when the dialog is
  103.         //  dismissed with OK
  104.     }
  105.     else if (nResponse == IDCANCEL)
  106.     {
  107.         // TODO: Place code here to handle when the dialog is
  108.         //  dismissed with Cancel
  109.     }
  110.  
  111.     // Since the dialog has been closed, return FALSE so that we exit the
  112.     //  application, rather than start the application's message pump.
  113.     return FALSE;
  114. }
  115.