Skip to content

Commit 8cf455e

Browse files
authored
MfcTyper
1 parent 1088702 commit 8cf455e

20 files changed

+999
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MfcTyper", "MfcTyper\MfcTyper.vcxproj", "{C0E78925-B9DC-452F-A7B6-46E366D3F0E4}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Win32 = Debug|Win32
9+
Release|Win32 = Release|Win32
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{C0E78925-B9DC-452F-A7B6-46E366D3F0E4}.Debug|Win32.ActiveCfg = Debug|Win32
13+
{C0E78925-B9DC-452F-A7B6-46E366D3F0E4}.Debug|Win32.Build.0 = Debug|Win32
14+
{C0E78925-B9DC-452F-A7B6-46E366D3F0E4}.Release|Win32.ActiveCfg = Release|Win32
15+
{C0E78925-B9DC-452F-A7B6-46E366D3F0E4}.Release|Win32.Build.0 = Release|Win32
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal
16.5 KB
Binary file not shown.
Binary file not shown.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
// MfcTyper.cpp : 定义应用程序的类行为。
3+
//
4+
5+
#include "stdafx.h"
6+
#include "MfcTyper.h"
7+
#include "MfcTyperDlg.h"
8+
9+
#ifdef _DEBUG
10+
#define new DEBUG_NEW
11+
#endif
12+
13+
14+
// CMfcTyperApp
15+
16+
BEGIN_MESSAGE_MAP(CMfcTyperApp, CWinApp)
17+
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
18+
END_MESSAGE_MAP()
19+
20+
21+
// CMfcTyperApp 构造
22+
23+
CMfcTyperApp::CMfcTyperApp()
24+
{
25+
// 支持重新启动管理器
26+
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
27+
28+
// TODO: 在此处添加构造代码,
29+
// 将所有重要的初始化放置在 InitInstance 中
30+
}
31+
32+
33+
// 唯一的一个 CMfcTyperApp 对象
34+
35+
CMfcTyperApp theApp;
36+
37+
38+
// CMfcTyperApp 初始化
39+
40+
BOOL CMfcTyperApp::InitInstance()
41+
{
42+
// 如果一个运行在 Windows XP 上的应用程序清单指定要
43+
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
44+
//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
45+
INITCOMMONCONTROLSEX InitCtrls;
46+
InitCtrls.dwSize = sizeof(InitCtrls);
47+
// 将它设置为包括所有要在应用程序中使用的
48+
// 公共控件类。
49+
InitCtrls.dwICC = ICC_WIN95_CLASSES;
50+
InitCommonControlsEx(&InitCtrls);
51+
52+
CWinApp::InitInstance();
53+
54+
55+
AfxEnableControlContainer();
56+
57+
// 创建 shell 管理器,以防对话框包含
58+
// 任何 shell 树视图控件或 shell 列表视图控件。
59+
CShellManager *pShellManager = new CShellManager;
60+
61+
// 标准初始化
62+
// 如果未使用这些功能并希望减小
63+
// 最终可执行文件的大小,则应移除下列
64+
// 不需要的特定初始化例程
65+
// 更改用于存储设置的注册表项
66+
// TODO: 应适当修改该字符串,
67+
// 例如修改为公司或组织名
68+
SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
69+
70+
CMfcTyperDlg dlg;
71+
m_pMainWnd = &dlg;
72+
INT_PTR nResponse = dlg.DoModal();
73+
if (nResponse == IDOK)
74+
{
75+
// TODO: 在此放置处理何时用
76+
// “确定”来关闭对话框的代码
77+
}
78+
else if (nResponse == IDCANCEL)
79+
{
80+
// TODO: 在此放置处理何时用
81+
// “取消”来关闭对话框的代码
82+
}
83+
84+
// 删除上面创建的 shell 管理器。
85+
if (pShellManager != NULL)
86+
{
87+
delete pShellManager;
88+
}
89+
90+
// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
91+
// 而不是启动应用程序的消息泵。
92+
return FALSE;
93+
}
94+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
// MfcTyper.h : PROJECT_NAME 应用程序的主头文件
3+
//
4+
5+
#pragma once
6+
7+
#ifndef __AFXWIN_H__
8+
#error "在包含此文件之前包含“stdafx.h”以生成 PCH 文件"
9+
#endif
10+
11+
#include "resource.h" // 主符号
12+
13+
14+
// CMfcTyperApp:
15+
// 有关此类的实现,请参阅 MfcTyper.cpp
16+
//
17+
18+
class CMfcTyperApp : public CWinApp
19+
{
20+
public:
21+
CMfcTyperApp();
22+
23+
// 重写
24+
public:
25+
virtual BOOL InitInstance();
26+
27+
// 实现
28+
29+
DECLARE_MESSAGE_MAP()
30+
};
31+
32+
extern CMfcTyperApp theApp;
Binary file not shown.
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{C0E78925-B9DC-452F-A7B6-46E366D3F0E4}</ProjectGuid>
15+
<RootNamespace>MfcTyper</RootNamespace>
16+
<Keyword>MFCProj</Keyword>
17+
</PropertyGroup>
18+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
20+
<ConfigurationType>Application</ConfigurationType>
21+
<UseDebugLibraries>true</UseDebugLibraries>
22+
<CharacterSet>Unicode</CharacterSet>
23+
<UseOfMfc>Static</UseOfMfc>
24+
</PropertyGroup>
25+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
26+
<ConfigurationType>Application</ConfigurationType>
27+
<UseDebugLibraries>false</UseDebugLibraries>
28+
<WholeProgramOptimization>true</WholeProgramOptimization>
29+
<CharacterSet>Unicode</CharacterSet>
30+
<UseOfMfc>Static</UseOfMfc>
31+
</PropertyGroup>
32+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
33+
<ImportGroup Label="ExtensionSettings">
34+
</ImportGroup>
35+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
36+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
37+
</ImportGroup>
38+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
39+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
40+
</ImportGroup>
41+
<PropertyGroup Label="UserMacros" />
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
43+
<LinkIncremental>true</LinkIncremental>
44+
</PropertyGroup>
45+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
46+
<LinkIncremental>false</LinkIncremental>
47+
<EmbedManifest>false</EmbedManifest>
48+
</PropertyGroup>
49+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
50+
<ClCompile>
51+
<PrecompiledHeader>Use</PrecompiledHeader>
52+
<WarningLevel>Level3</WarningLevel>
53+
<Optimization>Disabled</Optimization>
54+
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
55+
</ClCompile>
56+
<Link>
57+
<SubSystem>Windows</SubSystem>
58+
<GenerateDebugInformation>true</GenerateDebugInformation>
59+
</Link>
60+
<Midl>
61+
<MkTypLibCompatible>false</MkTypLibCompatible>
62+
<ValidateAllParameters>true</ValidateAllParameters>
63+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
64+
</Midl>
65+
<ResourceCompile>
66+
<Culture>0x0804</Culture>
67+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
68+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
69+
</ResourceCompile>
70+
</ItemDefinitionGroup>
71+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
72+
<ClCompile>
73+
<WarningLevel>Level3</WarningLevel>
74+
<PrecompiledHeader>Use</PrecompiledHeader>
75+
<Optimization>MaxSpeed</Optimization>
76+
<FunctionLevelLinking>true</FunctionLevelLinking>
77+
<IntrinsicFunctions>true</IntrinsicFunctions>
78+
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
79+
</ClCompile>
80+
<Link>
81+
<SubSystem>Windows</SubSystem>
82+
<GenerateDebugInformation>true</GenerateDebugInformation>
83+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
84+
<OptimizeReferences>true</OptimizeReferences>
85+
</Link>
86+
<Midl>
87+
<MkTypLibCompatible>false</MkTypLibCompatible>
88+
<ValidateAllParameters>true</ValidateAllParameters>
89+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
90+
</Midl>
91+
<ResourceCompile>
92+
<Culture>0x0804</Culture>
93+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
94+
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
95+
</ResourceCompile>
96+
</ItemDefinitionGroup>
97+
<ItemGroup>
98+
<None Include="ReadMe.txt" />
99+
<None Include="res\MfcTyper.ico" />
100+
<None Include="res\MfcTyper.rc2" />
101+
</ItemGroup>
102+
<ItemGroup>
103+
<ClInclude Include="MfcTyper.h" />
104+
<ClInclude Include="MfcTyperDlg.h" />
105+
<ClInclude Include="MyTyper.h" />
106+
<ClInclude Include="Resource.h" />
107+
<ClInclude Include="stdafx.h" />
108+
<ClInclude Include="targetver.h" />
109+
</ItemGroup>
110+
<ItemGroup>
111+
<ClCompile Include="MfcTyper.cpp" />
112+
<ClCompile Include="MfcTyperDlg.cpp" />
113+
<ClCompile Include="MyTyper.cpp" />
114+
<ClCompile Include="stdafx.cpp">
115+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
116+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
117+
</ClCompile>
118+
</ItemGroup>
119+
<ItemGroup>
120+
<ResourceCompile Include="MfcTyper.rc" />
121+
</ItemGroup>
122+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
123+
<ImportGroup Label="ExtensionTargets">
124+
</ImportGroup>
125+
<ProjectExtensions>
126+
<VisualStudio>
127+
<UserProperties RESOURCE_FILE="MfcTyper.rc" />
128+
</VisualStudio>
129+
</ProjectExtensions>
130+
</Project>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="源文件">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="头文件">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="资源文件">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<None Include="ReadMe.txt" />
19+
<None Include="res\MfcTyper.rc2">
20+
<Filter>资源文件</Filter>
21+
</None>
22+
<None Include="res\MfcTyper.ico">
23+
<Filter>资源文件</Filter>
24+
</None>
25+
</ItemGroup>
26+
<ItemGroup>
27+
<ClInclude Include="MfcTyper.h">
28+
<Filter>头文件</Filter>
29+
</ClInclude>
30+
<ClInclude Include="MfcTyperDlg.h">
31+
<Filter>头文件</Filter>
32+
</ClInclude>
33+
<ClInclude Include="stdafx.h">
34+
<Filter>头文件</Filter>
35+
</ClInclude>
36+
<ClInclude Include="targetver.h">
37+
<Filter>头文件</Filter>
38+
</ClInclude>
39+
<ClInclude Include="Resource.h">
40+
<Filter>头文件</Filter>
41+
</ClInclude>
42+
<ClInclude Include="MyTyper.h">
43+
<Filter>头文件</Filter>
44+
</ClInclude>
45+
</ItemGroup>
46+
<ItemGroup>
47+
<ClCompile Include="MfcTyper.cpp">
48+
<Filter>源文件</Filter>
49+
</ClCompile>
50+
<ClCompile Include="MfcTyperDlg.cpp">
51+
<Filter>源文件</Filter>
52+
</ClCompile>
53+
<ClCompile Include="stdafx.cpp">
54+
<Filter>源文件</Filter>
55+
</ClCompile>
56+
<ClCompile Include="MyTyper.cpp">
57+
<Filter>源文件</Filter>
58+
</ClCompile>
59+
</ItemGroup>
60+
<ItemGroup>
61+
<ResourceCompile Include="MfcTyper.rc">
62+
<Filter>资源文件</Filter>
63+
</ResourceCompile>
64+
</ItemGroup>
65+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
</Project>

0 commit comments

Comments
 (0)