00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "stdafx.h"
00013 #include "ControlPanel.h"
00014
00015 #include "MainFrm.h"
00016 #include "ControlPanelDoc.h"
00017 #include "ControlPanelView.h"
00018 #include "../Common/StaticUrl.h"
00019
00020 #ifdef _DEBUG
00021 #define new DEBUG_NEW
00022 #undef THIS_FILE
00023 static char THIS_FILE[] = __FILE__;
00024 #endif
00025
00027
00028
00029 BEGIN_MESSAGE_MAP(CControlPanelApp, CWinApp)
00030
00031 ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
00032
00033
00034
00035
00036 ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
00037 ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
00038
00039 ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
00040 END_MESSAGE_MAP()
00041
00043
00044
00045 CControlPanelApp::CControlPanelApp()
00046 {
00047
00048
00049 }
00050
00052
00053
00054 CControlPanelApp theApp;
00055
00057
00058
00059 BOOL CControlPanelApp::InitInstance()
00060 {
00061
00062 if (!AfxOleInit())
00063 {
00064 AfxMessageBox(IDP_OLE_INIT_FAILED);
00065 return FALSE;
00066 }
00067
00068
00069 SetRegistryKey(_T("Diolan\\U2C-12"));
00070
00071 LoadStdProfileSettings();
00072
00073
00074
00075
00076 CSingleDocTemplate* pDocTemplate;
00077 pDocTemplate = new CSingleDocTemplate(
00078 IDR_MAINFRAME,
00079 RUNTIME_CLASS(CControlPanelDoc),
00080 RUNTIME_CLASS(CMainFrame),
00081 RUNTIME_CLASS(CControlPanelView));
00082 pDocTemplate->SetContainerInfo(IDR_CNTR_INPLACE);
00083 AddDocTemplate(pDocTemplate);
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 CCommandLineInfo cmdInfo;
00099 ParseCommandLine(cmdInfo);
00100
00101
00102 if (!ProcessShellCommand(cmdInfo))
00103 return FALSE;
00104
00105
00106 m_pMainWnd->ShowWindow(SW_SHOW);
00107 m_pMainWnd->UpdateWindow();
00108
00109 return TRUE;
00110 }
00111
00112
00114
00115
00116 class CAboutDlg : public CDialog
00117 {
00118 public:
00119 CAboutDlg();
00120
00121
00122
00123 enum { IDD = IDD_ABOUTBOX };
00124
00125
00126
00127
00128 protected:
00129 virtual void DoDataExchange(CDataExchange* pDX);
00130
00131
00132
00133 protected:
00134
00135
00136
00137 DECLARE_MESSAGE_MAP()
00138 public:
00139 CStaticUrl m_Link;
00140 virtual BOOL OnInitDialog();
00141 };
00142
00143 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00144 {
00145
00146
00147
00148
00149 }
00150
00151 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00152 {
00153 CDialog::DoDataExchange(pDX);
00154
00155
00156 DDX_Control(pDX, IDC_A_LINK, m_Link);
00157 }
00158
00159 BOOL CAboutDlg::OnInitDialog()
00160 {
00161 CDialog::OnInitDialog();
00162 return TRUE;
00163 }
00164
00165
00166 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00167
00168
00169
00170 END_MESSAGE_MAP()
00171
00172
00173 void CControlPanelApp::OnAppAbout()
00174 {
00175 CAboutDlg aboutDlg;
00176 aboutDlg.DoModal();
00177 }
00178
00180
00181
00182