MFC-Simulator/TestSimulator/TestSimulator.cpp

103 lines
2.3 KiB
C++
Raw Normal View History

2023-02-03 03:07:52 +01:00
// TestSimulator.cpp : <20>w<EFBFBD>q<EFBFBD><71><EFBFBD>ε{<7B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>O<EFBFBD><EFBFBD>C
//
#include "stdafx.h"
#include "TestSimulator.h"
#include "TestSimulatorDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CTestSimulatorApp
BEGIN_MESSAGE_MAP(CTestSimulatorApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
// CTestSimulatorApp <20>غc
CTestSimulatorApp::CTestSimulatorApp()
{
// <20><EFBFBD><E4B4A9><EFBFBD>s<EFBFBD>Ұʺ޲z<DEB2><7A>
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
// TODO: <20>b<EFBFBD><62><EFBFBD>[<5B>J<EFBFBD>غc<D8BA>{<7B><><EFBFBD>X<EFBFBD>A
// <20>N<EFBFBD>Ҧ<EFBFBD><D2A6><EFBFBD><EFBFBD>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD>]<5D>w<EFBFBD>[<5B>J InitInstance <20><>
}
// <20>Ȧ<EFBFBD><C8A6><EFBFBD><EFBFBD>@<40><> CTestSimulatorApp <20><><EFBFBD><EFBFBD>
CTestSimulatorApp theApp;
// CTestSimulatorApp <20><><EFBFBD>l<EFBFBD>]<5D>w
BOOL CTestSimulatorApp::InitInstance()
{
// <20><><EFBFBD>p<EFBFBD><70><EFBFBD>ε{<7B><><EFBFBD><EFBFBD><EFBFBD>T<EFBFBD>M<EFBFBD><4D><EFBFBD><EFBFBD><EFBFBD>w<EFBFBD>ϥ<EFBFBD> ComCtl32.dll 6 (<28>t) <20>H<EFBFBD><EFBFBD><E1AAA9><EFBFBD>A
// <20>ӱҰʵ<D2B0>ı<EFBFBD>Ƽ˦<C6BC><CBA6>A<EFBFBD>b Windows XP <20>W<EFBFBD>A<EFBFBD>h<EFBFBD>ݭn InitCommonControls()<29>C
// <20>_<EFBFBD>h<EFBFBD><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>إ߳<D8A5><DFB3>N<EFBFBD><4E><EFBFBD>ѡC
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// <20>]<5D>w<EFBFBD>n<EFBFBD>]<5D>t<EFBFBD>Ҧ<EFBFBD><D2A6>z<EFBFBD>Q<EFBFBD>n<EFBFBD>Ω<EFBFBD><CEA9><EFBFBD><EFBFBD>ε{<7B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20>q<EFBFBD>α<EFBFBD><CEB1><EFBFBD><EEB6B5><EFBFBD>O<EFBFBD>C
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
AfxEnableControlContainer();
// <20>إߴ߼h<DFBC>޲z<DEB2><7A><EFBFBD>A<EFBFBD>H<EFBFBD><48><EFBFBD><EFBFBD><EFBFBD>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD>]<5D>t
// <20><><EFBFBD><EFBFBD><EFBFBD>߼h<DFBC><68><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>δ߼h<DFBC>M<EFBFBD><4D><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>C
CShellManager *pShellManager = new CShellManager;
// <20>Ұ<EFBFBD> [Windows <20><><EFBFBD><EFBFBD>] <20><>ı<EFBFBD>ƺ޲z<DEB2><7A><EFBFBD>i<EFBFBD>ҥ<EFBFBD> MFC <20><><EFBFBD><EFBFBD><EEB6B5><EFBFBD><EFBFBD><EFBFBD>D<EFBFBD>D
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
// <20>зǪ<D0B7><C7AA>l<EFBFBD>]<5D>w
// <20>p<EFBFBD>G<EFBFBD>z<EFBFBD><7A><EFBFBD>ϥγo<CEB3>ǥ\<5C><><EFBFBD>åB<C3A5>Q<EFBFBD><51><EFBFBD><EFBFBD>
// <20>̫᧹<CCAB><E1A7B9><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD><69><EFBFBD><EFBFBD><EFBFBD>ɤj<C9A4>p<EFBFBD>A<EFBFBD>z<EFBFBD>i<EFBFBD>H
// <20>q<EFBFBD>U<EFBFBD>C<EFBFBD>{<7B><><EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݭn<DDAD><6E><EFBFBD><EFBFBD><EFBFBD>l<EFBFBD>Ʊ`<60><><EFBFBD>A
// <20>ܧ<EFBFBD><DCA7>x<EFBFBD>s<EFBFBD>]<5D>w<EFBFBD>Ȫ<EFBFBD><C8AA>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>X
// TODO: <20>z<EFBFBD><7A><EFBFBD>ӾA<D3BE>׭ק惡<D7A7>r<EFBFBD><72>
// (<28>Ҧp<D2A6>A<EFBFBD><41><EFBFBD>q<EFBFBD>W<EFBFBD>٩β<D9A9>´<EFBFBD>W<EFBFBD><57>)
SetRegistryKey(_T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> AppWizard <20>Ҳ<EFBFBD><D2B2>ͪ<EFBFBD><CDAA><EFBFBD><EFBFBD>ε{<7B><>"));
CTestSimulatorDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: <20>b<EFBFBD><62><EFBFBD><EFBFBD><EFBFBD>m<EFBFBD><6D><EFBFBD>ϥ<EFBFBD> [<5B>T<EFBFBD>w] <20>Ӱ<EFBFBD><D3B0><EFBFBD><EFBFBD>ϥι<CFA5><CEB9>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD><EFBFBD>
// <20>B<EFBFBD>z<EFBFBD><7A><EFBFBD>{<7B><><EFBFBD>X
}
else if (nResponse == IDCANCEL)
{
// TODO: <20>b<EFBFBD><62><EFBFBD><EFBFBD><EFBFBD>m<EFBFBD><6D><EFBFBD>ϥ<EFBFBD> [<5B><><EFBFBD><EFBFBD>] <20>Ӱ<EFBFBD><D3B0><EFBFBD><EFBFBD>ϥι<CFA5><CEB9>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD><EFBFBD>
// <20>B<EFBFBD>z<EFBFBD><7A><EFBFBD>{<7B><><EFBFBD>X
}
else if (nResponse == -1)
{
TRACE(traceAppMsg, 0, "ĵ<EFBFBD>i: <20><><EFBFBD>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD>إߥ<D8A5><DFA5>ѡA<D1A1>]<5D><><EFBFBD>A<EFBFBD><41><EFBFBD>ε{<7B><><EFBFBD>N<EFBFBD>~<7E>פ<EFBFBD><D7A4>C\n");
TRACE(traceAppMsg, 0, "ĵ<EFBFBD>i: <20>p<EFBFBD>G<EFBFBD>z<EFBFBD>n<EFBFBD>b<EFBFBD><62><EFBFBD>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD>W<EFBFBD>ϥ<EFBFBD> MFC <20><><EFBFBD><EFBFBD>A<EFBFBD>h<EFBFBD>L<EFBFBD>k #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS<47>C\n");
}
// <20>R<EFBFBD><52><EFBFBD>W<EFBFBD><57><EFBFBD>ҫإߪ<D8A5><DFAA>߼h<DFBC>޲z<DEB2><7A><EFBFBD>C
if (pShellManager != NULL)
{
delete pShellManager;
}
// <20>]<5D><><EFBFBD>w<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD>A<EFBFBD>Ǧ^ FALSE<53>A<EFBFBD>ҥH<D2A5>ڭ̷|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ε{<7B><><EFBFBD>A
// <20>ӫD<D3AB><44><EFBFBD>ܶ}<7D>l<EFBFBD><6C><EFBFBD>ε{<7B><><EFBFBD><EFBFBD><EFBFBD>T<EFBFBD><54><EFBFBD>C
return FALSE;
}