From 7e91121a3357eae1427b47509322f77d802ea25b Mon Sep 17 00:00:00 2001 From: yuyoyuppe Date: Mon, 16 Dec 2019 13:12:36 +0300 Subject: [PATCH] PowerToy project template update (#934) * Add PowerToy project template to the PowerToys solution * Update PowerToy project template and create a separate solution for it --- PowerToyTemplate.sln | 25 + PowerToys.sln | 74 ++- tools/project_template/ModuleTemplate.zip | Bin 0 -> 8199 bytes .../ModuleTemplate/$projectname$.rc | 0 .../ModuleTemplate/ModuleTemplate.vcxproj | 11 +- .../ModuleTemplate/dllmain.cpp | 562 +++++++++--------- .../project_template/ModuleTemplate/trace.cpp | 43 +- tools/project_template/ModuleTemplate/trace.h | 9 +- .../PowerToysModuleTemplate.zip | Bin 7684 -> 0 bytes tools/project_template/README.md | 2 +- 10 files changed, 392 insertions(+), 334 deletions(-) create mode 100644 PowerToyTemplate.sln create mode 100644 tools/project_template/ModuleTemplate.zip create mode 100644 tools/project_template/ModuleTemplate/$projectname$.rc delete mode 100644 tools/project_template/PowerToysModuleTemplate.zip diff --git a/PowerToyTemplate.sln b/PowerToyTemplate.sln new file mode 100644 index 0000000000..300d5065d3 --- /dev/null +++ b/PowerToyTemplate.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29609.76 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModuleTemplate", "tools\project_template\ModuleTemplate\ModuleTemplate.vcxproj", "{64A80062-4D8B-4229-8A38-DFA1D7497749}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {64A80062-4D8B-4229-8A38-DFA1D7497749}.Debug|x64.ActiveCfg = Debug|x64 + {64A80062-4D8B-4229-8A38-DFA1D7497749}.Debug|x64.Build.0 = Debug|x64 + {64A80062-4D8B-4229-8A38-DFA1D7497749}.Release|x64.ActiveCfg = Release|x64 + {64A80062-4D8B-4229-8A38-DFA1D7497749}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DB382378-AE19-44E4-B0AC-136F03144AE7} + EndGlobalSection +EndGlobal diff --git a/PowerToys.sln b/PowerToys.sln index cdfa8aaa47..ede28c997e 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -39,6 +39,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fancyzones", "src\modules\f EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTests-FancyZones", "src\modules\fancyzones\tests\UnitTests\UnitTests.vcxproj", "{9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}" + ProjectSection(ProjectDependencies) = postProject + {F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99} = {F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99} + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{1AFB6476-670D-4E80-A464-657E01DFF482}" EndProject @@ -74,6 +77,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerRenameUnitTests", "src {B25AC7A5-FB9F-4789-B392-D5C85E948670} = {B25AC7A5-FB9F-4789-B392-D5C85E948670} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{BEEAB7F2-FFF6-45AB-9CDB-B04CC0734B88}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModuleTemplate", "tools\project_template\ModuleTemplate\ModuleTemplate.vcxproj", "{64A80062-4D8B-4229-8A38-DFA1D7497749}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -82,64 +89,68 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Debug|x64.ActiveCfg = Debug|x64 {9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Debug|x64.Build.0 = Debug|x64 - {9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Release|x64.ActiveCfg = Release|x64 - {9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Release|x64.Build.0 = Release|x64 + {9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Release|x64.ActiveCfg = Debug|x64 + {9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Release|x64.Build.0 = Debug|x64 {74485049-C722-400F-ABE5-86AC52D929B3}.Debug|x64.ActiveCfg = Debug|x64 {74485049-C722-400F-ABE5-86AC52D929B3}.Debug|x64.Build.0 = Debug|x64 - {74485049-C722-400F-ABE5-86AC52D929B3}.Release|x64.ActiveCfg = Release|x64 - {74485049-C722-400F-ABE5-86AC52D929B3}.Release|x64.Build.0 = Release|x64 + {74485049-C722-400F-ABE5-86AC52D929B3}.Release|x64.ActiveCfg = Debug|x64 + {74485049-C722-400F-ABE5-86AC52D929B3}.Release|x64.Build.0 = Debug|x64 {A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Debug|x64.ActiveCfg = Debug|x64 {A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Debug|x64.Build.0 = Debug|x64 - {A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Release|x64.ActiveCfg = Release|x64 - {A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Release|x64.Build.0 = Release|x64 + {A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Release|x64.ActiveCfg = Debug|x64 + {A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Release|x64.Build.0 = Debug|x64 {44CC9375-3E6E-4D99-8913-7FB748807EBD}.Debug|x64.ActiveCfg = Debug|x64 {44CC9375-3E6E-4D99-8913-7FB748807EBD}.Debug|x64.Build.0 = Debug|x64 - {44CC9375-3E6E-4D99-8913-7FB748807EBD}.Release|x64.ActiveCfg = Release|x64 - {44CC9375-3E6E-4D99-8913-7FB748807EBD}.Release|x64.Build.0 = Release|x64 + {44CC9375-3E6E-4D99-8913-7FB748807EBD}.Release|x64.ActiveCfg = Debug|x64 + {44CC9375-3E6E-4D99-8913-7FB748807EBD}.Release|x64.Build.0 = Debug|x64 {07C389E3-6BC8-41CF-923E-307B1265FA2D}.Debug|x64.ActiveCfg = Debug|x64 {07C389E3-6BC8-41CF-923E-307B1265FA2D}.Debug|x64.Build.0 = Debug|x64 - {07C389E3-6BC8-41CF-923E-307B1265FA2D}.Release|x64.ActiveCfg = Release|x64 - {07C389E3-6BC8-41CF-923E-307B1265FA2D}.Release|x64.Build.0 = Release|x64 + {07C389E3-6BC8-41CF-923E-307B1265FA2D}.Release|x64.ActiveCfg = Debug|x64 + {07C389E3-6BC8-41CF-923E-307B1265FA2D}.Release|x64.Build.0 = Debug|x64 {F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99}.Debug|x64.ActiveCfg = Debug|x64 {F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99}.Debug|x64.Build.0 = Debug|x64 - {F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99}.Release|x64.ActiveCfg = Release|x64 - {F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99}.Release|x64.Build.0 = Release|x64 + {F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99}.Release|x64.ActiveCfg = Debug|x64 + {F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99}.Release|x64.Build.0 = Debug|x64 {48804216-2A0E-4168-A6D8-9CD068D14227}.Debug|x64.ActiveCfg = Debug|x64 {48804216-2A0E-4168-A6D8-9CD068D14227}.Debug|x64.Build.0 = Debug|x64 - {48804216-2A0E-4168-A6D8-9CD068D14227}.Release|x64.ActiveCfg = Release|x64 - {48804216-2A0E-4168-A6D8-9CD068D14227}.Release|x64.Build.0 = Release|x64 + {48804216-2A0E-4168-A6D8-9CD068D14227}.Release|x64.ActiveCfg = Debug|x64 + {48804216-2A0E-4168-A6D8-9CD068D14227}.Release|x64.Build.0 = Debug|x64 {9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}.Debug|x64.ActiveCfg = Debug|x64 {9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}.Debug|x64.Build.0 = Debug|x64 - {9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}.Release|x64.ActiveCfg = Release|x64 - {9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}.Release|x64.Build.0 = Release|x64 + {9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}.Release|x64.ActiveCfg = Debug|x64 + {9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}.Release|x64.Build.0 = Debug|x64 {1A066C63-64B3-45F8-92FE-664E1CCE8077}.Debug|x64.ActiveCfg = Debug|x64 {1A066C63-64B3-45F8-92FE-664E1CCE8077}.Debug|x64.Build.0 = Debug|x64 - {1A066C63-64B3-45F8-92FE-664E1CCE8077}.Release|x64.ActiveCfg = Release|x64 - {1A066C63-64B3-45F8-92FE-664E1CCE8077}.Release|x64.Build.0 = Release|x64 + {1A066C63-64B3-45F8-92FE-664E1CCE8077}.Release|x64.ActiveCfg = Debug|x64 + {1A066C63-64B3-45F8-92FE-664E1CCE8077}.Release|x64.Build.0 = Debug|x64 {5CCC8468-DEC8-4D36-99D4-5C891BEBD481}.Debug|x64.ActiveCfg = Debug|x64 {5CCC8468-DEC8-4D36-99D4-5C891BEBD481}.Debug|x64.Build.0 = Debug|x64 - {5CCC8468-DEC8-4D36-99D4-5C891BEBD481}.Release|x64.ActiveCfg = Release|x64 - {5CCC8468-DEC8-4D36-99D4-5C891BEBD481}.Release|x64.Build.0 = Release|x64 + {5CCC8468-DEC8-4D36-99D4-5C891BEBD481}.Release|x64.ActiveCfg = Debug|x64 + {5CCC8468-DEC8-4D36-99D4-5C891BEBD481}.Release|x64.Build.0 = Debug|x64 {B25AC7A5-FB9F-4789-B392-D5C85E948670}.Debug|x64.ActiveCfg = Debug|x64 {B25AC7A5-FB9F-4789-B392-D5C85E948670}.Debug|x64.Build.0 = Debug|x64 - {B25AC7A5-FB9F-4789-B392-D5C85E948670}.Release|x64.ActiveCfg = Release|x64 - {B25AC7A5-FB9F-4789-B392-D5C85E948670}.Release|x64.Build.0 = Release|x64 + {B25AC7A5-FB9F-4789-B392-D5C85E948670}.Release|x64.ActiveCfg = Debug|x64 + {B25AC7A5-FB9F-4789-B392-D5C85E948670}.Release|x64.Build.0 = Debug|x64 {51920F1F-C28C-4ADF-8660-4238766796C2}.Debug|x64.ActiveCfg = Debug|x64 {51920F1F-C28C-4ADF-8660-4238766796C2}.Debug|x64.Build.0 = Debug|x64 - {51920F1F-C28C-4ADF-8660-4238766796C2}.Release|x64.ActiveCfg = Release|x64 - {51920F1F-C28C-4ADF-8660-4238766796C2}.Release|x64.Build.0 = Release|x64 + {51920F1F-C28C-4ADF-8660-4238766796C2}.Release|x64.ActiveCfg = Debug|x64 + {51920F1F-C28C-4ADF-8660-4238766796C2}.Release|x64.Build.0 = Debug|x64 {0E072714-D127-460B-AFAD-B4C40B412798}.Debug|x64.ActiveCfg = Debug|x64 {0E072714-D127-460B-AFAD-B4C40B412798}.Debug|x64.Build.0 = Debug|x64 - {0E072714-D127-460B-AFAD-B4C40B412798}.Release|x64.ActiveCfg = Release|x64 - {0E072714-D127-460B-AFAD-B4C40B412798}.Release|x64.Build.0 = Release|x64 + {0E072714-D127-460B-AFAD-B4C40B412798}.Release|x64.ActiveCfg = Debug|x64 + {0E072714-D127-460B-AFAD-B4C40B412798}.Release|x64.Build.0 = Debug|x64 {A3935CF4-46C5-4A88-84D3-6B12E16E6BA2}.Debug|x64.ActiveCfg = Debug|x64 {A3935CF4-46C5-4A88-84D3-6B12E16E6BA2}.Debug|x64.Build.0 = Debug|x64 - {A3935CF4-46C5-4A88-84D3-6B12E16E6BA2}.Release|x64.ActiveCfg = Release|x64 - {A3935CF4-46C5-4A88-84D3-6B12E16E6BA2}.Release|x64.Build.0 = Release|x64 + {A3935CF4-46C5-4A88-84D3-6B12E16E6BA2}.Release|x64.ActiveCfg = Debug|x64 + {A3935CF4-46C5-4A88-84D3-6B12E16E6BA2}.Release|x64.Build.0 = Debug|x64 {2151F984-E006-4A9F-92EF-C6DDE3DC8413}.Debug|x64.ActiveCfg = Debug|x64 {2151F984-E006-4A9F-92EF-C6DDE3DC8413}.Debug|x64.Build.0 = Debug|x64 - {2151F984-E006-4A9F-92EF-C6DDE3DC8413}.Release|x64.ActiveCfg = Release|x64 - {2151F984-E006-4A9F-92EF-C6DDE3DC8413}.Release|x64.Build.0 = Release|x64 + {2151F984-E006-4A9F-92EF-C6DDE3DC8413}.Release|x64.ActiveCfg = Debug|x64 + {2151F984-E006-4A9F-92EF-C6DDE3DC8413}.Release|x64.Build.0 = Debug|x64 + {64A80062-4D8B-4229-8A38-DFA1D7497749}.Debug|x64.ActiveCfg = Debug|x64 + {64A80062-4D8B-4229-8A38-DFA1D7497749}.Debug|x64.Build.0 = Debug|x64 + {64A80062-4D8B-4229-8A38-DFA1D7497749}.Release|x64.ActiveCfg = Debug|x64 + {64A80062-4D8B-4229-8A38-DFA1D7497749}.Release|x64.Build.0 = Debug|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -147,7 +158,7 @@ Global GlobalSection(NestedProjects) = preSolution {74485049-C722-400F-ABE5-86AC52D929B3} = {1AFB6476-670D-4E80-A464-657E01DFF482} {A46629C4-1A6C-40FA-A8B6-10E5102BB0BA} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC} - {44CC9375-3E6E-4D99-8913-7FB748807EBD} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC} + {44CC9375-3E6E-4D99-8913-7FB748807EBD} = {BEEAB7F2-FFF6-45AB-9CDB-B04CC0734B88} {3BB8493E-D18E-4485-A320-CB40F90F55AE} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC} {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC} {F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD} @@ -161,6 +172,7 @@ Global {0E072714-D127-460B-AFAD-B4C40B412798} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3} {A3935CF4-46C5-4A88-84D3-6B12E16E6BA2} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3} {2151F984-E006-4A9F-92EF-C6DDE3DC8413} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3} + {64A80062-4D8B-4229-8A38-DFA1D7497749} = {BEEAB7F2-FFF6-45AB-9CDB-B04CC0734B88} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0} diff --git a/tools/project_template/ModuleTemplate.zip b/tools/project_template/ModuleTemplate.zip new file mode 100644 index 0000000000000000000000000000000000000000..7c62fd985340059cee3b598233dc0cabf51dcbf4 GIT binary patch literal 8199 zcmbVx1yozv_jPc0C{}_5hf>^%yF0;M1BBq(VnvG;ifeHx1X_w0io2HL4#f+F;?{n2 z(50Dw?70N~C5teu>o77%9+D;Jk;!#!sNs zBkd4COzQi#&vv)+1R8RE1UlceA13%L*(>JG#_PPpQoUZky-hO~jS2Uj=oRmy!G^KK z&k59@KQB3Y$?iOU$w7V-@KcZmvds{qMBwY5;3J09$w4lD<0Ve<~$i=eD@P0ZjD zE5m0uG!1fc0C$e~k{DxT)*Cf8Td)zZ*d!6ACn>>Cly>g@+kGj-pNW zVxh)nnl8PGP#~Us3b;)l#JA4i{EWcZQ~h1=mCfR-7g}YBpY^(|ODTukMum$p$9bnx zi6uff+KPo#rDaVaY234e7gZDV!F=R!jAun6g*+>|dujava^I=QN-))VXgfMUY3OoP z)Qx(6WDpT35;BUhIjJ+T48+y>>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>D65xr4S%`BV!7PnnC7@cGE7hQYpH@#7mHAxZYyk9 z8ZDUOTUa-j>Y5@ev$FMdu7nIgSwDCs%p&95;Ua6?Uj1Y9F>P@=z%4MEv79uFT8j(BnNLtYqQfi zLydN@Fz`8F?1?+#sK!$+Ao=%cu{=|Jv4ZpZsAW9)(kI!MeIicZDgU0cuqCjhYh2moN; Oy+V)y0N5|x4)}jgG8%IL literal 0 HcmV?d00001 diff --git a/tools/project_template/ModuleTemplate/$projectname$.rc b/tools/project_template/ModuleTemplate/$projectname$.rc new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/project_template/ModuleTemplate/ModuleTemplate.vcxproj b/tools/project_template/ModuleTemplate/ModuleTemplate.vcxproj index 880a7479f2..6405bb3a58 100644 --- a/tools/project_template/ModuleTemplate/ModuleTemplate.vcxproj +++ b/tools/project_template/ModuleTemplate/ModuleTemplate.vcxproj @@ -12,7 +12,7 @@ 15.0 - {44CC9375-3E6E-4D99-8913-7FB748807EBD} + {64A80062-4D8B-4229-8A38-DFA1D7497749} Win32Proj templatenamespace 10.0 @@ -61,7 +61,6 @@ _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true pch.h - ..\..\common\inc;..\..\common\Telemetry;..\;..\..\;..\..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories) MultiThreadedDebug stdcpplatest @@ -82,7 +81,6 @@ NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true pch.h - ..\..\common\inc;..\..\common\Telemetry;..\;..\..\;..\..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories) MultiThreaded stdcpplatest @@ -94,6 +92,11 @@ $(OutDir)$(TargetName)$(TargetExt) + + + $(SolutionDir)src\;$(SolutionDir)src\modules;$(SolutionDir)src\common\Telemetry;%(AdditionalIncludeDirectories) + + @@ -110,7 +113,7 @@ - + {74485049-c722-400f-abe5-86ac52d929b3} diff --git a/tools/project_template/ModuleTemplate/dllmain.cpp b/tools/project_template/ModuleTemplate/dllmain.cpp index 59684096f7..be128ce14b 100644 --- a/tools/project_template/ModuleTemplate/dllmain.cpp +++ b/tools/project_template/ModuleTemplate/dllmain.cpp @@ -7,19 +7,21 @@ extern "C" IMAGE_DOS_HEADER __ImageBase; -BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { - switch (ul_reason_for_call) { - case DLL_PROCESS_ATTACH: - Trace::RegisterProvider(); - break; - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - break; - case DLL_PROCESS_DETACH: - Trace::UnregisterProvider(); - break; - } - return TRUE; +BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + Trace::RegisterProvider(); + break; + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + break; + case DLL_PROCESS_DETACH: + Trace::UnregisterProvider(); + break; + } + return TRUE; } // The PowerToy name that will be shown in the settings. @@ -28,297 +30,309 @@ const static wchar_t* MODULE_NAME = L"$projectname$"; const static wchar_t* MODULE_DESC = L""; // These are the properties shown in the Settings page. -struct ModuleSettings { - // Add the PowerToy module properties with default values. - // Currently available types: - // - int - // - bool - // - string +struct ModuleSettings +{ + // Add the PowerToy module properties with default values. + // Currently available types: + // - int + // - bool + // - string - //bool bool_prop = true; - //int int_prop = 10; - //std::wstring string_prop = L"The quick brown fox jumps over the lazy dog"; - //std::wstring color_prop = L"#1212FF"; + //bool bool_prop = true; + //int int_prop = 10; + //std::wstring string_prop = L"The quick brown fox jumps over the lazy dog"; + //std::wstring color_prop = L"#1212FF"; } g_settings; // Implement the PowerToy Module Interface and all the required methods. -class $safeprojectname$ : public PowertoyModuleIface { +class $safeprojectname$ : public PowertoyModuleIface +{ private: - // The PowerToy state. - bool m_enabled = false; + // The PowerToy state. + bool m_enabled = false; - // Load initial settings from the persisted values. - void init_settings(); + // Load initial settings from the persisted values. + void init_settings(); public: - // Constructor - $safeprojectname$() { - init_settings(); - }; + // Constructor + $safeprojectname$() + { + init_settings(); + }; - // Destroy the powertoy and free memory - virtual void destroy() override { - delete this; - } - - // Return the display name of the powertoy, this will be cached by the runner - virtual const wchar_t* get_name() override { - return MODULE_NAME; - } - - // Return array of the names of all events that this powertoy listens for, with - // nullptr as the last element of the array. Nullptr can also be retured for empty - // list. - virtual const wchar_t** get_events() override { - static const wchar_t* events[] = { nullptr }; - // Available events: - // - ll_keyboard - // - win_hook_event - // - // static const wchar_t* events[] = { ll_keyboard, - // win_hook_event, - // nullptr }; - - return events; - } - - // Return JSON with the configuration options. - virtual bool get_config(wchar_t* buffer, int* buffer_size) override { - HINSTANCE hinstance = reinterpret_cast(&__ImageBase); - - // Create a Settings object. - PowerToysSettings::Settings settings(hinstance, get_name()); - settings.set_description(MODULE_DESC); - - // Show an overview link in the Settings page - //settings.set_overview_link(L"https://"); - - // Show a video link in the Settings page. - //settings.set_video_link(L"https://"); - - // A bool property with a toggle editor. - /*settings.add_bool_toogle( - L"bool_toggle_1", // property name. - L"This is what a BoolToggle property looks like", // description or resource id of the localized string. - g_settings.bool_prop // property value. - );*/ - - // An integer property with a spinner editor. - /*settings.add_int_spinner( - L"int_spinner_1", // property name - L"This is what a IntSpinner property looks like", // description or resource id of the localized string. - g_settings.int_prop, // property value. - 0, // min value. - 100, // max value. - 10 // incremental step. - );*/ - - // A string property with a textbox editor. - /*settings.add_string( - L"string_text_1", // property name. - L"This is what a String property looks like", // description or resource id of the localized string. - g_settings.string_prop // property value. - );*/ - - // A string property with a color picker editor. - /*settings.add_color_picker( - L"color_picker_1", // property name. - L"This is what a ColorPicker property looks like", // description or resource id of the localized string. - g_settings.color_prop // property value. - );*/ - - // A custom action property. When using this settings type, the "PowertoyModuleIface::call_custom_action()" - // method should be overriden as well. - /*settings.add_custom_action( - L"custom_action_id", // action name. - L"This is what a CustomAction property looks like", // label above the field. - L"Call a custom action", // button text. - L"Press the button to call a custom action." // display values / extended info. - );*/ - - return settings.serialize_to_buffer(buffer, buffer_size); - } - - // Signal from the Settings editor to call a custom action. - // This can be used to spawn more complex editors. - virtual void call_custom_action(const wchar_t* action) override { - static UINT custom_action_num_calls = 0; - try { - // Parse the action values, including name. - PowerToysSettings::CustomActionObject action_object = - PowerToysSettings::CustomActionObject::from_json_string(action); - - /* - if (action_object.get_name() == L"custom_action_id") { - // Execute your custom action - } - */ + // Destroy the powertoy and free memory + virtual void destroy() override + { + delete this; } - catch (std::exception& ex) { - // Improper JSON. + + // Return the display name of the powertoy, this will be cached by the runner + virtual const wchar_t* get_name() override + { + return MODULE_NAME; } - } - // Called by the runner to pass the updated settings values as a serialized JSON. - virtual void set_config(const wchar_t* config) override { - try { - // Parse the input JSON string. - PowerToysSettings::PowerToyValues values = - PowerToysSettings::PowerToyValues::from_json_string(config); + // Return array of the names of all events that this powertoy listens for, with + // nullptr as the last element of the array. Nullptr can also be retured for empty + // list. + virtual const wchar_t** get_events() override + { + static const wchar_t* events[] = { nullptr }; + // Available events: + // - ll_keyboard + // - win_hook_event + // + // static const wchar_t* events[] = { ll_keyboard, + // win_hook_event, + // nullptr }; - // Update a bool property. - /* - if (values.is_bool_value(L"bool_toggle_1")) { - g_settings.bool_prop = values.get_bool_value(L"bool_toggle_1"); - } - */ - - // Update an int property. - /* - if (values.is_int_value(L"int_spinner_1")) { - g_settings.int_prop = values.get_int_value(L"int_spinner_1"); - } - */ - - // Update a string property. - /* - if (values.is_string_value(L"string_text_1")) { - g_settings.string_prop = values.get_string_value(L"string_text_1"); - } - */ - - // Update a color property. - /* - if (values.is_string_value(L"color_picker_1")) { - g_settings.color_prop = values.get_string_value(L"color_picker_1"); - } - */ - - // If you don't need to do any custom processing of the settings, proceed - // to persists the values calling: - values.save_to_settings_file(); - // Otherwise call a custom function to process the settings before saving them to disk: - // save_settings(); + return events; } - catch (std::exception& ex) { - // Improper JSON. + + // Return JSON with the configuration options. + virtual bool get_config(wchar_t* buffer, int* buffer_size) override + { + HINSTANCE hinstance = reinterpret_cast(&__ImageBase); + + // Create a Settings object. + PowerToysSettings::Settings settings(hinstance, get_name()); + settings.set_description(MODULE_DESC); + + // Show an overview link in the Settings page + //settings.set_overview_link(L"https://"); + + // Show a video link in the Settings page. + //settings.set_video_link(L"https://"); + + // A bool property with a toggle editor. + //settings.add_bool_toogle( + // L"bool_toggle_1", // property name. + // L"This is what a BoolToggle property looks like", // description or resource id of the localized string. + // g_settings.bool_prop // property value. + //); + + // An integer property with a spinner editor. + //settings.add_int_spinner( + // L"int_spinner_1", // property name + // L"This is what a IntSpinner property looks like", // description or resource id of the localized string. + // g_settings.int_prop, // property value. + // 0, // min value. + // 100, // max value. + // 10 // incremental step. + //); + + // A string property with a textbox editor. + //settings.add_string( + // L"string_text_1", // property name. + // L"This is what a String property looks like", // description or resource id of the localized string. + // g_settings.string_prop // property value. + //); + + // A string property with a color picker editor. + //settings.add_color_picker( + // L"color_picker_1", // property name. + // L"This is what a ColorPicker property looks like", // description or resource id of the localized string. + // g_settings.color_prop // property value. + //); + + // A custom action property. When using this settings type, the "PowertoyModuleIface::call_custom_action()" + // method should be overriden as well. + //settings.add_custom_action( + // L"custom_action_id", // action name. + // L"This is what a CustomAction property looks like", // label above the field. + // L"Call a custom action", // button text. + // L"Press the button to call a custom action." // display values / extended info. + //); + + return settings.serialize_to_buffer(buffer, buffer_size); } - } - // Enable the powertoy - virtual void enable() { - m_enabled = true; - } + // Signal from the Settings editor to call a custom action. + // This can be used to spawn more complex editors. + virtual void call_custom_action(const wchar_t* action) override + { + static UINT custom_action_num_calls = 0; + try + { + // Parse the action values, including name. + PowerToysSettings::CustomActionObject action_object = + PowerToysSettings::CustomActionObject::from_json_string(action); - // Disable the powertoy - virtual void disable() { - m_enabled = false; - } - - // Returns if the powertoys is enabled - virtual bool is_enabled() override { - return m_enabled; - } - - // Handle incoming event, data is event-specific - virtual intptr_t signal_event(const wchar_t* name, intptr_t data) override { - if (wcscmp(name, ll_keyboard) == 0) { - auto& event = *(reinterpret_cast(data)); - // Return 1 if the keypress is to be suppressed (not forwarded to Windows), - // otherwise return 0. - return 0; + //if (action_object.get_name() == L"custom_action_id") { + // // Execute your custom action + //} + } + catch (std::exception&) + { + // Improper JSON. + } } - else if (wcscmp(name, win_hook_event) == 0) { - auto& event = *(reinterpret_cast(data)); - // Return value is ignored - return 0; + + // Called by the runner to pass the updated settings values as a serialized JSON. + virtual void set_config(const wchar_t* config) override + { + try + { + // Parse the input JSON string. + PowerToysSettings::PowerToyValues values = + PowerToysSettings::PowerToyValues::from_json_string(config); + + // Update a bool property. + //if (auto v = values.get_bool_value(L"bool_toggle_1")) { + // g_settings.bool_prop = *v; + //} + + // Update an int property. + //if (auto v = values.get_int_value(L"int_spinner_1")) { + // g_settings.int_prop = *v; + //} + + // Update a string property. + //if (auto v = values.get_string_value(L"string_text_1")) { + // g_settings.string_prop = *v; + //} + + // Update a color property. + //if (auto v = values.get_string_value(L"color_picker_1")) { + // g_settings.color_prop = *v; + //} + + // If you don't need to do any custom processing of the settings, proceed + // to persists the values calling: + values.save_to_settings_file(); + // Otherwise call a custom function to process the settings before saving them to disk: + // save_settings(); + } + catch (std::exception&) + { + // Improper JSON. + } + } + + // Enable the powertoy + virtual void enable() + { + m_enabled = true; + } + + // Disable the powertoy + virtual void disable() + { + m_enabled = false; + } + + // Returns if the powertoys is enabled + virtual bool is_enabled() override + { + return m_enabled; + } + + // Handle incoming event, data is event-specific + virtual intptr_t signal_event(const wchar_t* name, intptr_t data) override + { + if (wcscmp(name, ll_keyboard) == 0) + { + auto& event = *(reinterpret_cast(data)); + // Return 1 if the keypress is to be suppressed (not forwarded to Windows), + // otherwise return 0. + return 0; + } + else if (wcscmp(name, win_hook_event) == 0) + { + auto& event = *(reinterpret_cast(data)); + // Return value is ignored + return 0; + } + return 0; + } + + // This methods are part of an experimental features not fully supported yet + virtual void register_system_menu_helper(PowertoySystemMenuIface* helper) override + { + } + + virtual void signal_system_menu_action(const wchar_t* name) override + { } - return 0; - } }; // Load the settings file. -void $safeprojectname$::init_settings() { - try { - // Load and parse the settings file for this PowerToy. - PowerToysSettings::PowerToyValues settings = - PowerToysSettings::PowerToyValues::load_from_settings_file($safeprojectname$::get_name()); +void $safeprojectname$::init_settings() +{ + try + { + // Load and parse the settings file for this PowerToy. + PowerToysSettings::PowerToyValues settings = + PowerToysSettings::PowerToyValues::load_from_settings_file($safeprojectname$::get_name()); - // Load a bool property. - /* - if (settings.is_bool_value(L"bool_toggle_1")) { - g_settings.bool_prop = settings.get_bool_value(L"bool_toggle_1"); - } - */ + // Load a bool property. + //if (auto v = settings.get_bool_value(L"bool_toggle_1")) { + // g_settings.bool_prop = *v; + //} - // Load an int property. - /* - if (settings.is_int_value(L"int_spinner_1")) { - g_settings.int_prop = settings.get_int_value(L"int_spinner_1"); - } - */ + // Load an int property. + //if (auto v = settings.get_int_value(L"int_spinner_1")) { + // g_settings.int_prop = *v; + //} - // Load a string property. - /* - if (settings.is_string_value(L"string_text_1")) { - g_settings.string_prop = settings.get_string_value(L"string_text_1"); - } - */ + // Load a string property. + //if (auto v = settings.get_string_value(L"string_text_1")) { + // g_settings.string_prop = *v; + //} - // Load a color property. - /* - if (settings.is_string_value(L"color_picker_1")) { - g_settings.color_prop = settings.get_string_value(L"color_picker_1"); + // Load a color property. + //if (auto v = settings.get_string_value(L"color_picker_1")) { + // g_settings.color_prop = *v; + //} + } + catch (std::exception&) + { + // Error while loading from the settings file. Let default values stay as they are. } - */ - } - catch (std::exception& ex) { - // Error while loading from the settings file. Let default values stay as they are. - } } // This method of saving the module settings is only required if you need to do any // custom processing of the settings before saving them to disk. -/* -void $projectname$::save_settings() { - try { - // Create a PowerToyValues object for this PowerToy - PowerToysSettings::PowerToyValues values(get_name()); +//void $projectname$::save_settings() { +// try { +// // Create a PowerToyValues object for this PowerToy +// PowerToysSettings::PowerToyValues values(get_name()); +// +// // Save a bool property. +// //values.add_property( +// // L"bool_toggle_1", // property name +// // g_settings.bool_prop // property value +// //); +// +// // Save an int property. +// //values.add_property( +// // L"int_spinner_1", // property name +// // g_settings.int_prop // property value +// //); +// +// // Save a string property. +// //values.add_property( +// // L"string_text_1", // property name +// // g_settings.string_prop // property value +// ); +// +// // Save a color property. +// //values.add_property( +// // L"color_picker_1", // property name +// // g_settings.color_prop // property value +// //); +// +// // Save the PowerToyValues JSON to the power toy settings file. +// values.save_to_settings_file(); +// } +// catch (std::exception ex) { +// // Couldn't save the settings. +// } +//} - // Save a bool property. - //values.add_property( - // L"bool_toggle_1", // property name - // g_settings.bool_prop // property value - //); - - // Save an int property. - //values.add_property( - // L"int_spinner_1", // property name - // g_settings.int_prop // property value - //); - - // Save a string property. - //values.add_property( - // L"string_text_1", // property name - // g_settings.string_prop // property value - ); - - // Save a color property. - //values.add_property( - // L"color_picker_1", // property name - // g_settings.color_prop // property value - //); - - // Save the PowerToyValues JSON to the power toy settings file. - values.save_to_settings_file(); - } - catch (std::exception ex) { - // Couldn't save the settings. - } -} -*/ - -extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create() { - return new $safeprojectname$(); -} +extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create() +{ + return new $safeprojectname$(); +} \ No newline at end of file diff --git a/tools/project_template/ModuleTemplate/trace.cpp b/tools/project_template/ModuleTemplate/trace.cpp index 94ae6d8fd9..d8c81500f8 100644 --- a/tools/project_template/ModuleTemplate/trace.cpp +++ b/tools/project_template/ModuleTemplate/trace.cpp @@ -2,25 +2,28 @@ #include "trace.h" TRACELOGGING_DEFINE_PROVIDER( - g_hProvider, - "Microsoft.PowerToys", - // {38e8889b-9731-53f5-e901-e8a7c1753074} - (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), - TraceLoggingOptionProjectTelemetry()); - -void Trace::RegisterProvider() { - TraceLoggingRegister(g_hProvider); -} - -void Trace::UnregisterProvider() { - TraceLoggingUnregister(g_hProvider); -} - -void Trace::MyEvent() { - TraceLoggingWrite( g_hProvider, - "PowerToyName::Event::MyEvent", - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); + "Microsoft.PowerToys", + // {38e8889b-9731-53f5-e901-e8a7c1753074} + (0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74), + TraceLoggingOptionProjectTelemetry()); + +void Trace::RegisterProvider() +{ + TraceLoggingRegister(g_hProvider); +} + +void Trace::UnregisterProvider() +{ + TraceLoggingUnregister(g_hProvider); +} + +void Trace::MyEvent() +{ + TraceLoggingWrite( + g_hProvider, + "PowerToyName_MyEvent", + ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), + TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), + TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); } diff --git a/tools/project_template/ModuleTemplate/trace.h b/tools/project_template/ModuleTemplate/trace.h index 92cef7fc80..3939f62fd1 100644 --- a/tools/project_template/ModuleTemplate/trace.h +++ b/tools/project_template/ModuleTemplate/trace.h @@ -1,8 +1,9 @@ #pragma once -class Trace { +class Trace +{ public: - static void RegisterProvider(); - static void UnregisterProvider(); - static void MyEvent(); + static void RegisterProvider(); + static void UnregisterProvider(); + static void MyEvent(); }; diff --git a/tools/project_template/PowerToysModuleTemplate.zip b/tools/project_template/PowerToysModuleTemplate.zip deleted file mode 100644 index 5ebc1886369823703b8123b65b76448a6ff5496a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7684 zcmZ`;1ymJl*FK~)NViCb^r0IO@z9-8hZZ=8ZV*sFI3Qip(%lUb($W%#2Bk~7;m7N} zpWpAg->mhnSu<;%J$v5$%-+wtUln;IWI_M{fChklAW}x+*Xj310RTRe0szGKcNHOK zF1F?x=5|n96K8V{SFk(O5n{8eqY9ak!}FEcy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Y~1Ju!bN6}6NFKeZzyVB#J3|t$c;_i zt1Ofub(8xk(IaC%hnQ7Wi(>u5COvrwW!5S|HK1xk?Y+UkhEIXj3eu2L?Uupm3{6=MyL0_1F>Qze4@1ZIqov zr0iKA_l)GeN*&z)%tSwbW{-bD&Ee|g{P&(niKb%MEEir2$>pOr)3X7qwa03r*!TQf?Vf0LJKO>g-Pxuhs_&Fe?dtYo22CbgWRpARDmlRP+9uV#}3gANH z7S_s|g6YsOsgIBuoHwi(&yi zJV26GEpt)E7JE$Wl}$uX;Q@&2CkglMD<;B=BG{4Nlj7~70M9cls*bB>8L)mPRO#GC zR0XPOq?ukOSsuEk)S19pM1(N~!& zF0qq9;8PV7vyVxagh#aM(w22V$QULtIZ(LKk0JZc~FQrTpAP?4iN8VruK9k0!1tj4D8N5qf9j6kFyi}}{Y!xUhWxu! z_zj7_hy1s2_!*zybNi=s_>F75$NeoNe!uM3XZ>02e}g3N^Ti(laRmPf|Fe|*hSQS# rTVeTy|HY|)%TGV?zha0@_CKW=hgoK(srCS diff --git a/tools/project_template/README.md b/tools/project_template/README.md index 65d9f471fc..25746c288d 100644 --- a/tools/project_template/README.md +++ b/tools/project_template/README.md @@ -2,7 +2,7 @@ ## Installation -- Put the `PowerToy Module.zip` file inside the `%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplate\Visual C++` folder. +- Put the `ModuleTemplate.zip` file inside the `%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplates\` folder, which is the default *User project templates location*. You can change that location via `Tools > Options > Projects and Solutions`. - The template will be available in Visual Studio, when adding a new project, under the `Visual C++` tab. ## Create a new PowerToy Module