mirror of
https://github.com/huiyiruciduojiao/FuckScreenCap.git
synced 2026-01-28 03:54:37 +08:00
添加了简单的图形化界面操作和配置文件的支持
This commit is contained in:
385
ConfigManager/ConfigManager.cpp
Normal file
385
ConfigManager/ConfigManager.cpp
Normal file
@@ -0,0 +1,385 @@
|
||||
// ConfigManager.cpp : 定义静态库的函数。
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "framework.h"
|
||||
#include "ConfigManager.h"
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <Windows.h>
|
||||
#include <Shlwapi.h>
|
||||
|
||||
#pragma comment(lib,"shlwapi.lib")
|
||||
|
||||
// TODO: 这是一个库函数示例
|
||||
namespace ConfigManager {
|
||||
|
||||
// ProcessFilterConfig 实现
|
||||
void ProcessFilterConfig::clear() {
|
||||
processList.clear();
|
||||
mode = WHITELIST;
|
||||
caseSensitive = false;
|
||||
}
|
||||
|
||||
// Config 类实现
|
||||
Config::Config() {
|
||||
m_configFilePath = getDefaultConfigPath();
|
||||
}
|
||||
|
||||
Config::Config(const std::string& configPath) : m_configFilePath(configPath) {
|
||||
}
|
||||
|
||||
std::string Config::toLowerCase(const std::string& str) const {
|
||||
std::string result = str;
|
||||
std::transform(result.begin(), result.end(), result.begin(), ::tolower);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string Config::trim(const std::string& str) const {
|
||||
size_t start = str.find_first_not_of(" \t\r\n");
|
||||
if (start == std::string::npos) return "";
|
||||
size_t end = str.find_last_not_of(" \t\r\n");
|
||||
return str.substr(start, end - start + 1);
|
||||
}
|
||||
|
||||
bool Config::fileExists(const std::string& filePath) const {
|
||||
return GetFileAttributesA(filePath.c_str()) != INVALID_FILE_ATTRIBUTES;
|
||||
}
|
||||
|
||||
void Config::setConfigPath(const std::string& configPath) {
|
||||
m_configFilePath = configPath;
|
||||
}
|
||||
|
||||
std::string Config::getConfigPath() const {
|
||||
return m_configFilePath;
|
||||
}
|
||||
|
||||
std::string Config::getDefaultConfigPath() const {
|
||||
char exePath[MAX_PATH] = { 0 };
|
||||
GetModuleFileNameA(NULL, exePath, MAX_PATH);
|
||||
PathRemoveFileSpecA(exePath);
|
||||
PathAppendA(exePath, "process_filter.ini");
|
||||
return std::string(exePath);
|
||||
}
|
||||
|
||||
bool Config::loadConfig() {
|
||||
return loadConfig(m_configFilePath);
|
||||
}
|
||||
|
||||
bool Config::loadConfig(const std::string& configPath) {
|
||||
m_filterConfig.clear();
|
||||
|
||||
std::ifstream configFile(configPath);
|
||||
if (!configFile.is_open()) {
|
||||
std::cerr << "Warning: 无法打开配置文件: " << configPath << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string line;
|
||||
bool inProcessSection = false;
|
||||
|
||||
std::cout << "Info: 开始读取配置文件: " << configPath << std::endl;
|
||||
|
||||
while (std::getline(configFile, line)) {
|
||||
line = trim(line);
|
||||
|
||||
// 跳过空行和注释
|
||||
if (line.empty() || line.front() == '#' || line.front() == ';') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 检查是否是节标题
|
||||
if (line.front() == '[' && line.back() == ']') {
|
||||
std::string section = line.substr(1, line.length() - 2);
|
||||
section = trim(section);
|
||||
inProcessSection = (toLowerCase(section) == "process");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!inProcessSection) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 解析配置项
|
||||
size_t equalPos = line.find('=');
|
||||
if (equalPos == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string key = trim(line.substr(0, equalPos));
|
||||
std::string value = trim(line.substr(equalPos + 1));
|
||||
|
||||
key = toLowerCase(key);
|
||||
|
||||
if (key == "mode") {
|
||||
value = toLowerCase(value);
|
||||
if (value == "whitelist" || value == "white") {
|
||||
m_filterConfig.mode = ProcessFilterConfig::WHITELIST;
|
||||
std::cout << "Info: 设置为白名单模式" << std::endl;
|
||||
}
|
||||
else if (value == "blacklist" || value == "black") {
|
||||
m_filterConfig.mode = ProcessFilterConfig::BLACKLIST;
|
||||
std::cout << "Info: 设置为黑名单模式" << std::endl;
|
||||
}
|
||||
}
|
||||
else if (key == "casesensitive") {
|
||||
value = toLowerCase(value);
|
||||
m_filterConfig.caseSensitive = (value == "true" || value == "1" || value == "yes");
|
||||
std::cout << "Info: 大小写敏感: " << (m_filterConfig.caseSensitive ? "开启" : "关闭") << std::endl;
|
||||
}
|
||||
else if (key == "list") {
|
||||
// 解析进程列表,支持逗号分隔
|
||||
std::stringstream ss(value);
|
||||
std::string processName;
|
||||
while (std::getline(ss, processName, ',')) {
|
||||
processName = trim(processName);
|
||||
if (!processName.empty()) {
|
||||
if (!m_filterConfig.caseSensitive) {
|
||||
processName = toLowerCase(processName);
|
||||
}
|
||||
m_filterConfig.processList.insert(processName);
|
||||
std::cout << "Info: 添加进程: " << processName << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configFile.close();
|
||||
|
||||
std::cout << "Info: 配置文件加载完成,共加载 " << m_filterConfig.processList.size() << " 个进程名" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Config::saveDefaultConfig() const {
|
||||
return saveDefaultConfig(m_configFilePath);
|
||||
}
|
||||
|
||||
bool Config::saveDefaultConfig(const std::string& configPath) const {
|
||||
std::ofstream configFile(configPath);
|
||||
if (!configFile.is_open()) {
|
||||
std::cerr << "Error: 无法创建配置文件: " << configPath << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
configFile << "# 进程过滤配置文件\n";
|
||||
configFile << "# 支持的配置项:\n";
|
||||
configFile << "# mode: whitelist(白名单) 或 blacklist(黑名单)\n";
|
||||
configFile << "# casesensitive: true(大小写敏感) 或 false(大小写不敏感)\n";
|
||||
configFile << "# list: 进程名列表,用逗号分隔\n\n";
|
||||
|
||||
configFile << "[Process]\n";
|
||||
configFile << "# 过滤模式: whitelist(只处理列表中的进程) 或 blacklist(处理除列表外的进程)\n";
|
||||
configFile << "mode = whitelist\n\n";
|
||||
|
||||
configFile << "# 是否大小写敏感\n";
|
||||
configFile << "casesensitive = false\n\n";
|
||||
|
||||
configFile << "# 进程名列表(包含.exe后缀),用逗号分隔\n";
|
||||
configFile << "list = chrome.exe, msedge.exe, mstsc.exe, notepad.exe, calc.exe\n\n";
|
||||
|
||||
configFile << "# 示例黑名单配置:\n";
|
||||
configFile << "# mode = blacklist\n";
|
||||
configFile << "# list = explorer.exe, winlogon.exe, csrss.exe, smss.exe\n";
|
||||
|
||||
configFile.close();
|
||||
|
||||
std::cout << "Info: 默认配置文件已创建: " << configPath << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Config::reloadConfig() {
|
||||
// 如果配置文件不存在,创建默认配置
|
||||
if (!fileExists(m_configFilePath)) {
|
||||
std::cout << "Warning: 配置文件不存在,创建默认配置" << std::endl;
|
||||
if (!saveDefaultConfig()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return loadConfig();
|
||||
}
|
||||
|
||||
const ProcessFilterConfig& Config::getProcessFilterConfig() const {
|
||||
return m_filterConfig;
|
||||
}
|
||||
|
||||
ProcessFilterConfig& Config::getProcessFilterConfig() {
|
||||
return m_filterConfig;
|
||||
}
|
||||
|
||||
bool Config::shouldProcessBeHooked(const std::string& processName) const {
|
||||
if (m_filterConfig.processList.empty()) {
|
||||
// 如果没有配置,使用默认行为
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string nameToCheck = processName;
|
||||
if (!m_filterConfig.caseSensitive) {
|
||||
nameToCheck = toLowerCase(processName);
|
||||
}
|
||||
|
||||
bool inList = m_filterConfig.processList.find(nameToCheck) != m_filterConfig.processList.end();
|
||||
|
||||
if (m_filterConfig.mode == ProcessFilterConfig::WHITELIST) {
|
||||
return inList; // 白名单模式:只处理列表中的进程
|
||||
}
|
||||
else {
|
||||
return !inList; // 黑名单模式:处理列表外的进程
|
||||
}
|
||||
}
|
||||
|
||||
void Config::setFilterMode(ProcessFilterConfig::FilterMode mode) {
|
||||
m_filterConfig.mode = mode;
|
||||
}
|
||||
|
||||
ProcessFilterConfig::FilterMode Config::getFilterMode() const {
|
||||
return m_filterConfig.mode;
|
||||
}
|
||||
|
||||
void Config::setCaseSensitive(bool sensitive) {
|
||||
m_filterConfig.caseSensitive = sensitive;
|
||||
}
|
||||
|
||||
bool Config::isCaseSensitive() const {
|
||||
return m_filterConfig.caseSensitive;
|
||||
}
|
||||
|
||||
void Config::addProcess(const std::string& processName) {
|
||||
std::string nameToAdd = processName;
|
||||
if (!m_filterConfig.caseSensitive) {
|
||||
nameToAdd = toLowerCase(processName);
|
||||
}
|
||||
m_filterConfig.processList.insert(nameToAdd);
|
||||
}
|
||||
|
||||
void Config::removeProcess(const std::string& processName) {
|
||||
std::string nameToRemove = processName;
|
||||
if (!m_filterConfig.caseSensitive) {
|
||||
nameToRemove = toLowerCase(processName);
|
||||
}
|
||||
m_filterConfig.processList.erase(nameToRemove);
|
||||
}
|
||||
|
||||
void Config::clearProcessList() {
|
||||
m_filterConfig.processList.clear();
|
||||
}
|
||||
|
||||
std::vector<std::string> Config::getProcessList() const {
|
||||
std::vector<std::string> result;
|
||||
result.reserve(m_filterConfig.processList.size());
|
||||
for (const auto& process : m_filterConfig.processList) {
|
||||
result.push_back(process);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t Config::getProcessCount() const {
|
||||
return m_filterConfig.processList.size();
|
||||
}
|
||||
|
||||
bool Config::isConfigValid() const {
|
||||
return !m_configFilePath.empty();
|
||||
}
|
||||
|
||||
void Config::printConfig() const {
|
||||
std::cout << "=== 配置信息 ===" << std::endl;
|
||||
std::cout << "配置文件路径: " << m_configFilePath << std::endl;
|
||||
std::cout << "过滤模式: " << (m_filterConfig.mode == ProcessFilterConfig::WHITELIST ? "白名单" : "黑名单") << std::endl;
|
||||
std::cout << "大小写敏感: " << (m_filterConfig.caseSensitive ? "是" : "否") << std::endl;
|
||||
std::cout << "进程列表 (" << m_filterConfig.processList.size() << "个):" << std::endl;
|
||||
for (const auto& process : m_filterConfig.processList) {
|
||||
std::cout << " - " << process << std::endl;
|
||||
}
|
||||
std::cout << "================" << std::endl;
|
||||
}
|
||||
|
||||
// GlobalConfig 静态成员初始化
|
||||
Config* GlobalConfig::s_instance = nullptr;
|
||||
bool GlobalConfig::s_initialized = false;
|
||||
|
||||
bool GlobalConfig::initialize() {
|
||||
if (s_initialized) {
|
||||
return true;
|
||||
}
|
||||
|
||||
s_instance = new Config();
|
||||
s_initialized = s_instance->reloadConfig();
|
||||
|
||||
if (!s_initialized) {
|
||||
delete s_instance;
|
||||
s_instance = nullptr;
|
||||
}
|
||||
|
||||
return s_initialized;
|
||||
}
|
||||
|
||||
bool GlobalConfig::initialize(const std::string& configPath) {
|
||||
if (s_initialized) {
|
||||
return true;
|
||||
}
|
||||
|
||||
s_instance = new Config(configPath);
|
||||
s_initialized = s_instance->reloadConfig();
|
||||
|
||||
if (!s_initialized) {
|
||||
delete s_instance;
|
||||
s_instance = nullptr;
|
||||
}
|
||||
|
||||
return s_initialized;
|
||||
}
|
||||
|
||||
void GlobalConfig::cleanup() {
|
||||
if (s_instance) {
|
||||
delete s_instance;
|
||||
s_instance = nullptr;
|
||||
}
|
||||
s_initialized = false;
|
||||
}
|
||||
|
||||
Config* GlobalConfig::getInstance() {
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
bool GlobalConfig::isInitialized() {
|
||||
return s_initialized;
|
||||
}
|
||||
|
||||
// 便捷函数实现
|
||||
bool initializeGlobalConfig() {
|
||||
return GlobalConfig::initialize();
|
||||
}
|
||||
|
||||
bool initializeGlobalConfig(const std::string& configPath) {
|
||||
return GlobalConfig::initialize(configPath);
|
||||
}
|
||||
|
||||
Config* getGlobalConfig() {
|
||||
return GlobalConfig::getInstance();
|
||||
}
|
||||
|
||||
void cleanupGlobalConfig() {
|
||||
GlobalConfig::cleanup();
|
||||
}
|
||||
|
||||
bool shouldProcessBeHooked(const std::string& processName) {
|
||||
|
||||
Config* config = GlobalConfig::getInstance();
|
||||
if (!config) {
|
||||
initializeGlobalConfig();
|
||||
config = GlobalConfig::getInstance();
|
||||
}
|
||||
return config->shouldProcessBeHooked(processName);
|
||||
}
|
||||
|
||||
bool reloadGlobalConfig() {
|
||||
Config* config = GlobalConfig::getInstance();
|
||||
if (!config) {
|
||||
return false;
|
||||
}
|
||||
return config->reloadConfig();
|
||||
}
|
||||
|
||||
} // namespace ConfigManager
|
||||
107
ConfigManager/ConfigManager.h
Normal file
107
ConfigManager/ConfigManager.h
Normal file
@@ -0,0 +1,107 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̹<EFBFBD><CCB9>˺<EFBFBD><CBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
||||
*/
|
||||
namespace ConfigManager {
|
||||
|
||||
// <20><><EFBFBD>̹<EFBFBD><CCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ýṹ
|
||||
struct ProcessFilterConfig {
|
||||
enum FilterMode {
|
||||
WHITELIST, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1>еĽ<D0B5><C4BD><EFBFBD>
|
||||
BLACKLIST // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>
|
||||
};
|
||||
|
||||
FilterMode mode = WHITELIST;
|
||||
std::unordered_set<std::string> processList;
|
||||
bool caseSensitive = false;
|
||||
|
||||
void clear();
|
||||
};
|
||||
|
||||
// <20><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
class Config {
|
||||
private:
|
||||
ProcessFilterConfig m_filterConfig;
|
||||
std::string m_configFilePath;
|
||||
|
||||
// <20><><EFBFBD>ߺ<EFBFBD><DFBA><EFBFBD>
|
||||
std::string toLowerCase(const std::string& str) const;
|
||||
std::string trim(const std::string& str) const;
|
||||
bool fileExists(const std::string& filePath) const;
|
||||
|
||||
public:
|
||||
Config();
|
||||
explicit Config(const std::string& configPath);
|
||||
~Config() = default;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void setConfigPath(const std::string& configPath);
|
||||
std::string getConfigPath() const;
|
||||
std::string getDefaultConfigPath() const;
|
||||
|
||||
// <20><><EFBFBD>ü<EFBFBD><C3BC>غͱ<D8BA><CDB1><EFBFBD>
|
||||
bool loadConfig();
|
||||
bool loadConfig(const std::string& configPath);
|
||||
bool saveDefaultConfig() const;
|
||||
bool saveDefaultConfig(const std::string& configPath) const;
|
||||
bool reloadConfig();
|
||||
|
||||
// <20><><EFBFBD>̹<EFBFBD><CCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>
|
||||
const ProcessFilterConfig& getProcessFilterConfig() const;
|
||||
ProcessFilterConfig& getProcessFilterConfig();
|
||||
|
||||
// <20><><EFBFBD>̹<EFBFBD><CCB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ط<EFBFBD><D8B7><EFBFBD>
|
||||
bool shouldProcessBeHooked(const std::string& processName) const;
|
||||
void setFilterMode(ProcessFilterConfig::FilterMode mode);
|
||||
ProcessFilterConfig::FilterMode getFilterMode() const;
|
||||
void setCaseSensitive(bool sensitive);
|
||||
bool isCaseSensitive() const;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
|
||||
void addProcess(const std::string& processName);
|
||||
void removeProcess(const std::string& processName);
|
||||
void clearProcessList();
|
||||
std::vector<std::string> getProcessList() const;
|
||||
size_t getProcessCount() const;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤
|
||||
bool isConfigValid() const;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
void printConfig() const;
|
||||
};
|
||||
|
||||
// ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
class GlobalConfig {
|
||||
private:
|
||||
static Config* s_instance;
|
||||
static bool s_initialized;
|
||||
|
||||
public:
|
||||
static bool initialize();
|
||||
static bool initialize(const std::string& configPath);
|
||||
static void cleanup();
|
||||
static Config* getInstance();
|
||||
static bool isInitialized();
|
||||
};
|
||||
|
||||
// <20><><EFBFBD>ݺ<EFBFBD><DDBA><EFBFBD>
|
||||
bool initializeGlobalConfig();
|
||||
bool initializeGlobalConfig(const std::string& configPath);
|
||||
Config* getGlobalConfig();
|
||||
void cleanupGlobalConfig();
|
||||
|
||||
// ֱ<>Ӳ<EFBFBD><D3B2><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD>õı<C3B5><C4B1>ݺ<EFBFBD><DDBA><EFBFBD>
|
||||
bool shouldProcessBeHooked(const std::string& processName);
|
||||
bool reloadGlobalConfig();
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>Ժ궨<D4BA><EAB6A8>
|
||||
#define PROCESS_FILTER_WHITELIST ConfigManager::ProcessFilterConfig::WHITELIST
|
||||
#define PROCESS_FILTER_BLACKLIST ConfigManager::ProcessFilterConfig::BLACKLIST
|
||||
155
ConfigManager/ConfigManager.vcxproj
Normal file
155
ConfigManager/ConfigManager.vcxproj
Normal file
@@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" 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>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{b5afeb98-c976-4839-9a8e-4f48b057d7fd}</ProjectGuid>
|
||||
<RootNamespace>ConfigManager</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</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>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<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|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ConfigManager.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ConfigManager.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
36
ConfigManager/ConfigManager.vcxproj.filters
Normal file
36
ConfigManager/ConfigManager.vcxproj.filters
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;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>
|
||||
<ClInclude Include="framework.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pch.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ConfigManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ConfigManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
3
ConfigManager/framework.h
Normal file
3
ConfigManager/framework.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容
|
||||
5
ConfigManager/pch.cpp
Normal file
5
ConfigManager/pch.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
// pch.cpp: 与预编译标头对应的源文件
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
// 当使用预编译的头时,需要使用此源文件,编译才能成功。
|
||||
13
ConfigManager/pch.h
Normal file
13
ConfigManager/pch.h
Normal file
@@ -0,0 +1,13 @@
|
||||
// pch.h: 这是预编译标头文件。
|
||||
// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
|
||||
// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
|
||||
// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
|
||||
// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
|
||||
|
||||
#ifndef PCH_H
|
||||
#define PCH_H
|
||||
|
||||
// 添加要在此处预编译的标头
|
||||
#include "framework.h"
|
||||
|
||||
#endif //PCH_H
|
||||
Reference in New Issue
Block a user