pgrsbar.cpp
上传用户:nhyuejuan
上传日期:2013-12-02
资源大小:171k
文件大小:3k
源码类别:

状态条

开发平台:

Visual C++

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Project:PGRSBAR
  3. // Author:NorthTibet
  4. // Date:星期二, 十二月 31, 2002
  5. // Description:在状态栏例实现进程指示器控制。
  6. //
  7. /////////////////////////////////////////////////////////////////////////////
  8. // pgrsbar.cpp : Defines the class behaviors for the application.
  9. //
  10. #include "stdafx.h"
  11. #include "pgrsbar.h"
  12. #include "about.h"
  13. #include "MainFrm.h"
  14. #include "Doc.h"
  15. #include "View.h"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CMyApp
  23. BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
  24. //{{AFX_MSG_MAP(CMyApp)
  25. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  26. // NOTE - the ClassWizard will add and remove mapping macros here.
  27. //    DO NOT EDIT what you see in these blocks of generated code!
  28. //}}AFX_MSG_MAP
  29. // Standard file based document commands
  30. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  31. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CMyApp construction
  35. CMyApp::CMyApp()
  36. {
  37. // TODO: add construction code here,
  38. // Place all significant initialization in InitInstance
  39. }
  40. /////////////////////////////////////////////////////////////////////////////
  41. // The one and only CMyApp object
  42. CMyApp theApp;
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CMyApp initialization
  45. BOOL CMyApp::InitInstance()
  46. {
  47. // Standard initialization
  48. // If you are not using these features and wish to reduce the size
  49. //  of your final executable, you should remove from the following
  50. //  the specific initialization routines you do not need.
  51. #ifdef _AFXDLL
  52. Enable3dControls(); // Call this when using MFC in a shared DLL
  53. #else
  54. Enable3dControlsStatic(); // Call this when linking to MFC statically
  55. #endif
  56. // Change the registry key under which our settings are stored.
  57. // TODO: You should modify this string to be something appropriate
  58. // such as the name of your company or organization.
  59. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  60. LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  61. // Register the application's document templates.  Document templates
  62. //  serve as the connection between documents, frame windows and views.
  63. CSingleDocTemplate* pDocTemplate;
  64. pDocTemplate = new CSingleDocTemplate(
  65. IDR_MAINFRAME,
  66. RUNTIME_CLASS(CMyDoc),
  67. RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  68. RUNTIME_CLASS(CMyView));
  69. AddDocTemplate(pDocTemplate);
  70. // Parse command line for standard shell commands, DDE, file open
  71. CCommandLineInfo cmdInfo;
  72. ParseCommandLine(cmdInfo);
  73. // Dispatch commands specified on the command line
  74. if (!ProcessShellCommand(cmdInfo))
  75. return FALSE;
  76. // The one and only window has been initialized, so show and update it.
  77. m_pMainWnd->ShowWindow(SW_SHOW);
  78. m_pMainWnd->UpdateWindow();
  79. return TRUE;
  80. }
  81. // App command to run the About dialog
  82. void CMyApp::OnAppAbout()
  83. {
  84. CAboutDlg().DoModal();
  85. }
  86. /////////////////////////////////////////////////////////////////////////////
  87. // CMyApp message handlers