ProgressDemo.cpp
上传用户:xp758258
上传日期:2007-01-02
资源大小:40k
文件大小:3k
源码类别:

状态条

开发平台:

Visual C++

  1. // ProgressDemo.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "ProgressDemo.h"
  5. #include "MainFrm.h"
  6. #include "ProgressDemoDoc.h"
  7. #include "ProgressDemoView.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CProgressDemoApp
  15. BEGIN_MESSAGE_MAP(CProgressDemoApp, CWinApp)
  16. //{{AFX_MSG_MAP(CProgressDemoApp)
  17. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  18. //}}AFX_MSG_MAP
  19. // Standard file based document commands
  20. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  21. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  22. END_MESSAGE_MAP()
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CProgressDemoApp construction
  25. CProgressDemoApp::CProgressDemoApp()
  26. {
  27. }
  28. /////////////////////////////////////////////////////////////////////////////
  29. // The one and only CProgressDemoApp object
  30. CProgressDemoApp theApp;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CProgressDemoApp initialization
  33. BOOL CProgressDemoApp::InitInstance()
  34. {
  35. AfxEnableControlContainer();
  36. // Standard initialization
  37. #ifdef _AFXDLL
  38. Enable3dControls(); // Call this when using MFC in a shared DLL
  39. #else
  40. Enable3dControlsStatic(); // Call this when linking to MFC statically
  41. #endif
  42. // Change the registry key under which our settings are stored.
  43. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  44. LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  45. // Register document templates
  46. CSingleDocTemplate* pDocTemplate;
  47. pDocTemplate = new CSingleDocTemplate(
  48. IDR_MAINFRAME,
  49. RUNTIME_CLASS(CProgressDemoDoc),
  50. RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  51. RUNTIME_CLASS(CProgressDemoView));
  52. AddDocTemplate(pDocTemplate);
  53. // Parse command line for standard shell commands, DDE, file open
  54. CCommandLineInfo cmdInfo;
  55. ParseCommandLine(cmdInfo);
  56. // Dispatch commands specified on the command line
  57. if (!ProcessShellCommand(cmdInfo))
  58. return FALSE;
  59. m_pMainWnd->ShowWindow(SW_SHOW);
  60. m_pMainWnd->UpdateWindow();
  61. return TRUE;
  62. }
  63. /////////////////////////////////////////////////////////////////////////////
  64. // CAboutDlg dialog used for App About
  65. class CAboutDlg : public CDialog
  66. {
  67. public:
  68. CAboutDlg();
  69. // Dialog Data
  70. //{{AFX_DATA(CAboutDlg)
  71. enum { IDD = IDD_ABOUTBOX };
  72. //}}AFX_DATA
  73. // ClassWizard generated virtual function overrides
  74. //{{AFX_VIRTUAL(CAboutDlg)
  75. protected:
  76. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  77. //}}AFX_VIRTUAL
  78. // Implementation
  79. protected:
  80. //{{AFX_MSG(CAboutDlg)
  81. // No message handlers
  82. //}}AFX_MSG
  83. DECLARE_MESSAGE_MAP()
  84. };
  85. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  86. {
  87. //{{AFX_DATA_INIT(CAboutDlg)
  88. //}}AFX_DATA_INIT
  89. }
  90. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  91. {
  92. CDialog::DoDataExchange(pDX);
  93. //{{AFX_DATA_MAP(CAboutDlg)
  94. //}}AFX_DATA_MAP
  95. }
  96. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  97. //{{AFX_MSG_MAP(CAboutDlg)
  98. // No message handlers
  99. //}}AFX_MSG_MAP
  100. END_MESSAGE_MAP()
  101. // App command to run the dialog
  102. void CProgressDemoApp::OnAppAbout()
  103. {
  104. CAboutDlg aboutDlg;
  105. aboutDlg.DoModal();
  106. }
  107. /////////////////////////////////////////////////////////////////////////////
  108. // CProgressDemoApp commands