From e5bbeb738e86ab78e22f728c53c20e582bb7c276 Mon Sep 17 00:00:00 2001 From: seraphima Date: Wed, 12 Jun 2024 17:24:50 +0200 Subject: [PATCH] updated SnapshotTool project --- .../ProjectsSnapshotTool.vcxproj | 180 ++++++++++-------- .../ProjectsSnapshotTool.vcxproj.filters | 4 - .../Projects/ProjectsSnapshotTool/main.cpp | 11 +- 3 files changed, 103 insertions(+), 92 deletions(-) diff --git a/src/modules/Projects/ProjectsSnapshotTool/ProjectsSnapshotTool.vcxproj b/src/modules/Projects/ProjectsSnapshotTool/ProjectsSnapshotTool.vcxproj index c6787132b5..1c13c273fc 100644 --- a/src/modules/Projects/ProjectsSnapshotTool/ProjectsSnapshotTool.vcxproj +++ b/src/modules/Projects/ProjectsSnapshotTool/ProjectsSnapshotTool.vcxproj @@ -1,46 +1,67 @@ - - + + + + + + + + Level3 + false + true + stdcpplatest + /await %(AdditionalOptions) + _UNICODE;UNICODE;%(PreprocessorDefinitions) + + + Windows + + + true + + + + + + _DEBUG;%(PreprocessorDefinitions) + Disabled + true + MultiThreadedDebug + + + true + + + + + NDEBUG;%(PreprocessorDefinitions) + MaxSpeed + false + MultiThreaded + true + true + + + true + true + true + + + - true - true - true - true - true - 15.0 - {3d63307b-9d27-44fd-b033-b26f39245b85} + 16.0 Win32Proj + {3d63307b-9d27-44fd-b033-b26f39245b85} ProjectsSnapshotTool - 10.0.22621.0 - 10.0.17134.0 - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - + Application v143 - v142 - v141 - v140 Unicode + Spectre + true true @@ -58,90 +79,83 @@ - - - - - - Use - pch.h - $(IntDir)pch.pch - _CONSOLE;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions) - Level4 - %(AdditionalOptions) /permissive- /bigobj - stdcpplatest - - + + PowerToys.$(MSBuildProjectName) + ..\..\..\..\$(Platform)\$(Configuration)\ + + + true + + + false + - Disabled - _DEBUG;%(PreprocessorDefinitions) + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + ./../;$(SolutionDir)src\common\Telemetry;$(SolutionDir)src\common;$(SolutionDir)src\;./;%(AdditionalIncludeDirectories) - Console - false - shcore.lib;Shell32.lib;propsys.lib;%(AdditionalDependencies) + Windows + true + shcore.lib;Shell32.lib;propsys.lib;%(AdditionalDependencies) - - - WIN32;%(PreprocessorDefinitions) - - - MaxSpeed + Level3 true true - NDEBUG;%(PreprocessorDefinitions) + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + ./../;$(SolutionDir)src\common\Telemetry;$(SolutionDir)src\common;$(SolutionDir)src\;./;%(AdditionalIncludeDirectories) - Console + Windows true true - false - shcore.lib;Shell32.lib;propsys.lib;%(AdditionalDependencies) + true + shcore.lib;Shell32.lib;propsys.lib;%(AdditionalDependencies) - - - MultiThreadedDebug + + + + + + Create - - - - MultiThreaded - - + - - - - - Create - + - - + + {d9b8fc84-322a-4f9f-bbb9-20915c47ddfd} + + + {6955446d-23f7-4023-9bb3-8657f904af99} + + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + \ No newline at end of file diff --git a/src/modules/Projects/ProjectsSnapshotTool/ProjectsSnapshotTool.vcxproj.filters b/src/modules/Projects/ProjectsSnapshotTool/ProjectsSnapshotTool.vcxproj.filters index 10c15cc520..e2cf60e92b 100644 --- a/src/modules/Projects/ProjectsSnapshotTool/ProjectsSnapshotTool.vcxproj.filters +++ b/src/modules/Projects/ProjectsSnapshotTool/ProjectsSnapshotTool.vcxproj.filters @@ -39,10 +39,6 @@ Source Files - - - - diff --git a/src/modules/Projects/ProjectsSnapshotTool/main.cpp b/src/modules/Projects/ProjectsSnapshotTool/main.cpp index 3d4b0d417d..c6631594e0 100644 --- a/src/modules/Projects/ProjectsSnapshotTool/main.cpp +++ b/src/modules/Projects/ProjectsSnapshotTool/main.cpp @@ -11,7 +11,7 @@ #include "MonitorUtils.h" -int main(int argc, char* argv[]) +int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, PSTR cmdline, int cmdshow) { SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); @@ -23,11 +23,12 @@ int main(int argc, char* argv[]) } std::wstring fileName = JsonUtils::ProjectsFile(); - if (argc > 1) + int len = MultiByteToWideChar(CP_ACP, 0, cmdline, -1, NULL, 0); + if (len > 1) { - std::string fileNameParam = argv[1]; - std::wstring filenameStr(fileNameParam.begin(), fileNameParam.end()); - fileName = filenameStr; + std::wstring fileNameParam(len, L'\0'); + MultiByteToWideChar(CP_ACP, 0, cmdline, -1, &fileNameParam[0], len); + fileName = fileNameParam; } // read previously saved projects