Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
4.2 KiB

  1. // FileSpy.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "FileSpyApp.h"
  5. #include "MainFrm.h"
  6. #include "FileSpyDoc.h"
  7. #include "LeftView.h"
  8. #define MAINMODULE
  9. #include "global.h"
  10. #undef MAINMODULE
  11. #include "protos.h"
  12. #include "init.cpp"
  13. #include "drvcomm.cpp"
  14. #include "support.cpp"
  15. #include "drive.cpp"
  16. #ifdef _DEBUG
  17. #define new DEBUG_NEW
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CFileSpyApp
  23. BEGIN_MESSAGE_MAP(CFileSpyApp, CWinApp)
  24. //{{AFX_MSG_MAP(CFileSpyApp)
  25. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  26. //}}AFX_MSG_MAP
  27. // Standard file based document commands
  28. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  29. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  30. END_MESSAGE_MAP()
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CFileSpyApp construction
  33. CFileSpyApp::CFileSpyApp()
  34. {
  35. // TODO: add construction code here,
  36. // Place all significant initialization in InitInstance
  37. }
  38. /////////////////////////////////////////////////////////////////////////////
  39. // The one and only CFileSpyApp object
  40. CFileSpyApp theApp;
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CFileSpyApp initialization
  43. BOOL CFileSpyApp::InitInstance()
  44. {
  45. // Standard initialization
  46. // If you are not using these features and wish to reduce the size
  47. // of your final executable, you should remove from the following
  48. // the specific initialization routines you do not need.
  49. #ifdef _AFXDLL
  50. Enable3dControls(); // Call this when using MFC in a shared DLL
  51. #else
  52. Enable3dControlsStatic(); // Call this when linking to MFC statically
  53. #endif
  54. // Change the registry key under which our settings are stored.
  55. // TODO: You should modify this string to be something appropriate
  56. // such as the name of your company or organization.
  57. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  58. LoadStdProfileSettings(0); // Load standard INI file options (including MRU)
  59. //
  60. // Program Initialization
  61. //
  62. ProgramInit();
  63. // Register the application's document templates. Document templates
  64. // serve as the connection between documents, frame windows and views.
  65. CSingleDocTemplate* pDocTemplate;
  66. pDocTemplate = new CSingleDocTemplate(
  67. IDR_MAINFRAME,
  68. RUNTIME_CLASS(CFileSpyDoc),
  69. RUNTIME_CLASS(CMainFrame), // main SDI frame window
  70. RUNTIME_CLASS(CLeftView));
  71. AddDocTemplate(pDocTemplate);
  72. // Parse command line for standard shell commands, DDE, file open
  73. CCommandLineInfo cmdInfo;
  74. ParseCommandLine(cmdInfo);
  75. // Dispatch commands specified on the command line
  76. if (!ProcessShellCommand(cmdInfo)) {
  77. return FALSE;
  78. }
  79. if (!StartFileSpy()) {
  80. return FALSE;
  81. }
  82. //
  83. //Set main window title
  84. //
  85. m_pMainWnd->SetWindowText(L"FileSpy");
  86. // The one and only window has been initialized, so show and update it.
  87. m_pMainWnd->ShowWindow(SW_SHOW);
  88. m_pMainWnd->UpdateWindow();
  89. return TRUE;
  90. }
  91. /////////////////////////////////////////////////////////////////////////////
  92. // CAboutDlg dialog used for App About
  93. class CAboutDlg : public CDialog
  94. {
  95. public:
  96. CAboutDlg();
  97. // Dialog Data
  98. //{{AFX_DATA(CAboutDlg)
  99. enum { IDD = IDD_ABOUTBOX };
  100. //}}AFX_DATA
  101. // ClassWizard generated virtual function overrides
  102. //{{AFX_VIRTUAL(CAboutDlg)
  103. protected:
  104. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  105. //}}AFX_VIRTUAL
  106. // Implementation
  107. protected:
  108. //{{AFX_MSG(CAboutDlg)
  109. // No message handlers
  110. //}}AFX_MSG
  111. DECLARE_MESSAGE_MAP()
  112. };
  113. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  114. {
  115. //{{AFX_DATA_INIT(CAboutDlg)
  116. //}}AFX_DATA_INIT
  117. }
  118. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  119. {
  120. CDialog::DoDataExchange(pDX);
  121. //{{AFX_DATA_MAP(CAboutDlg)
  122. //}}AFX_DATA_MAP
  123. }
  124. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  125. //{{AFX_MSG_MAP(CAboutDlg)
  126. // No message handlers
  127. //}}AFX_MSG_MAP
  128. END_MESSAGE_MAP()
  129. // App command to run the dialog
  130. void CFileSpyApp::OnAppAbout()
  131. {
  132. CAboutDlg aboutDlg;
  133. aboutDlg.DoModal();
  134. }
  135. /////////////////////////////////////////////////////////////////////////////
  136. // CFileSpyApp message handlers