mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 17:42:45 +08:00
PowerToy project template update (#934)
* Add PowerToy project template to the PowerToys solution * Update PowerToy project template and create a separate solution for it
This commit is contained in:
parent
7efe6f1d53
commit
7e91121a33
25
PowerToyTemplate.sln
Normal file
25
PowerToyTemplate.sln
Normal file
@ -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
|
@ -39,6 +39,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fancyzones", "src\modules\f
|
|||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTests-FancyZones", "src\modules\fancyzones\tests\UnitTests\UnitTests.vcxproj", "{9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}"
|
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
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{1AFB6476-670D-4E80-A464-657E01DFF482}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{1AFB6476-670D-4E80-A464-657E01DFF482}"
|
||||||
EndProject
|
EndProject
|
||||||
@ -74,6 +77,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PowerRenameUnitTests", "src
|
|||||||
{B25AC7A5-FB9F-4789-B392-D5C85E948670} = {B25AC7A5-FB9F-4789-B392-D5C85E948670}
|
{B25AC7A5-FB9F-4789-B392-D5C85E948670} = {B25AC7A5-FB9F-4789-B392-D5C85E948670}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
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
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
@ -82,64 +89,68 @@ Global
|
|||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Debug|x64.ActiveCfg = Debug|x64
|
{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}.Debug|x64.Build.0 = Debug|x64
|
||||||
{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Release|x64.ActiveCfg = Release|x64
|
{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Release|x64.ActiveCfg = Debug|x64
|
||||||
{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{74485049-C722-400F-ABE5-86AC52D929B3}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{74485049-C722-400F-ABE5-86AC52D929B3}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{48804216-2A0E-4168-A6D8-9CD068D14227}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{48804216-2A0E-4168-A6D8-9CD068D14227}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{9C6A7905-72D4-4BF5-B256-ABFDAEF68AE9}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{1A066C63-64B3-45F8-92FE-664E1CCE8077}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{1A066C63-64B3-45F8-92FE-664E1CCE8077}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{5CCC8468-DEC8-4D36-99D4-5C891BEBD481}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{5CCC8468-DEC8-4D36-99D4-5C891BEBD481}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{B25AC7A5-FB9F-4789-B392-D5C85E948670}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{B25AC7A5-FB9F-4789-B392-D5C85E948670}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{51920F1F-C28C-4ADF-8660-4238766796C2}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{51920F1F-C28C-4ADF-8660-4238766796C2}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{0E072714-D127-460B-AFAD-B4C40B412798}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{0E072714-D127-460B-AFAD-B4C40B412798}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{A3935CF4-46C5-4A88-84D3-6B12E16E6BA2}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{A3935CF4-46C5-4A88-84D3-6B12E16E6BA2}.Release|x64.Build.0 = Release|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.ActiveCfg = Debug|x64
|
||||||
{2151F984-E006-4A9F-92EF-C6DDE3DC8413}.Debug|x64.Build.0 = 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.ActiveCfg = Debug|x64
|
||||||
{2151F984-E006-4A9F-92EF-C6DDE3DC8413}.Release|x64.Build.0 = Release|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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@ -147,7 +158,7 @@ Global
|
|||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{74485049-C722-400F-ABE5-86AC52D929B3} = {1AFB6476-670D-4E80-A464-657E01DFF482}
|
{74485049-C722-400F-ABE5-86AC52D929B3} = {1AFB6476-670D-4E80-A464-657E01DFF482}
|
||||||
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
|
{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}
|
{3BB8493E-D18E-4485-A320-CB40F90F55AE} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
|
||||||
{D1D6BC88-09AE-4FB4-AD24-5DED46A791DD} = {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}
|
{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}
|
{0E072714-D127-460B-AFAD-B4C40B412798} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3}
|
||||||
{A3935CF4-46C5-4A88-84D3-6B12E16E6BA2} = {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}
|
{2151F984-E006-4A9F-92EF-C6DDE3DC8413} = {89E20BCE-EB9C-46C8-8B50-E01A82E6FDC3}
|
||||||
|
{64A80062-4D8B-4229-8A38-DFA1D7497749} = {BEEAB7F2-FFF6-45AB-9CDB-B04CC0734B88}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
|
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
|
||||||
|
BIN
tools/project_template/ModuleTemplate.zip
Normal file
BIN
tools/project_template/ModuleTemplate.zip
Normal file
Binary file not shown.
@ -12,7 +12,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<VCProjectVersion>15.0</VCProjectVersion>
|
<VCProjectVersion>15.0</VCProjectVersion>
|
||||||
<ProjectGuid>{44CC9375-3E6E-4D99-8913-7FB748807EBD}</ProjectGuid>
|
<ProjectGuid>{64A80062-4D8B-4229-8A38-DFA1D7497749}</ProjectGuid>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>templatenamespace</RootNamespace>
|
<RootNamespace>templatenamespace</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
@ -61,7 +61,6 @@
|
|||||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
<AdditionalIncludeDirectories>..\..\common\inc;..\..\common\Telemetry;..\;..\..\;..\..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -82,7 +81,6 @@
|
|||||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
<AdditionalIncludeDirectories>..\..\common\inc;..\..\common\Telemetry;..\;..\..\;..\..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@ -94,6 +92,11 @@
|
|||||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>$(SolutionDir)src\;$(SolutionDir)src\modules;$(SolutionDir)src\common\Telemetry;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="pch.h" />
|
<ClInclude Include="pch.h" />
|
||||||
<ClInclude Include="resource.h" />
|
<ClInclude Include="resource.h" />
|
||||||
@ -110,7 +113,7 @@
|
|||||||
<ClCompile Include="trace.cpp" />
|
<ClCompile Include="trace.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\common\common.vcxproj">
|
<ProjectReference Include="$(SolutionDir)src\common\common.vcxproj">
|
||||||
<Project>{74485049-c722-400f-abe5-86ac52d929b3}</Project>
|
<Project>{74485049-c722-400f-abe5-86ac52d929b3}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -7,19 +7,21 @@
|
|||||||
|
|
||||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||||
|
|
||||||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
|
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||||
switch (ul_reason_for_call) {
|
{
|
||||||
case DLL_PROCESS_ATTACH:
|
switch (ul_reason_for_call)
|
||||||
Trace::RegisterProvider();
|
{
|
||||||
break;
|
case DLL_PROCESS_ATTACH:
|
||||||
case DLL_THREAD_ATTACH:
|
Trace::RegisterProvider();
|
||||||
case DLL_THREAD_DETACH:
|
break;
|
||||||
break;
|
case DLL_THREAD_ATTACH:
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_THREAD_DETACH:
|
||||||
Trace::UnregisterProvider();
|
break;
|
||||||
break;
|
case DLL_PROCESS_DETACH:
|
||||||
}
|
Trace::UnregisterProvider();
|
||||||
return TRUE;
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The PowerToy name that will be shown in the settings.
|
// 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"<no description>";
|
const static wchar_t* MODULE_DESC = L"<no description>";
|
||||||
|
|
||||||
// These are the properties shown in the Settings page.
|
// These are the properties shown in the Settings page.
|
||||||
struct ModuleSettings {
|
struct ModuleSettings
|
||||||
// Add the PowerToy module properties with default values.
|
{
|
||||||
// Currently available types:
|
// Add the PowerToy module properties with default values.
|
||||||
// - int
|
// Currently available types:
|
||||||
// - bool
|
// - int
|
||||||
// - string
|
// - bool
|
||||||
|
// - string
|
||||||
|
|
||||||
//bool bool_prop = true;
|
//bool bool_prop = true;
|
||||||
//int int_prop = 10;
|
//int int_prop = 10;
|
||||||
//std::wstring string_prop = L"The quick brown fox jumps over the lazy dog";
|
//std::wstring string_prop = L"The quick brown fox jumps over the lazy dog";
|
||||||
//std::wstring color_prop = L"#1212FF";
|
//std::wstring color_prop = L"#1212FF";
|
||||||
|
|
||||||
} g_settings;
|
} g_settings;
|
||||||
|
|
||||||
// Implement the PowerToy Module Interface and all the required methods.
|
// Implement the PowerToy Module Interface and all the required methods.
|
||||||
class $safeprojectname$ : public PowertoyModuleIface {
|
class $safeprojectname$ : public PowertoyModuleIface
|
||||||
|
{
|
||||||
private:
|
private:
|
||||||
// The PowerToy state.
|
// The PowerToy state.
|
||||||
bool m_enabled = false;
|
bool m_enabled = false;
|
||||||
|
|
||||||
// Load initial settings from the persisted values.
|
// Load initial settings from the persisted values.
|
||||||
void init_settings();
|
void init_settings();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
$safeprojectname$() {
|
$safeprojectname$()
|
||||||
init_settings();
|
{
|
||||||
};
|
init_settings();
|
||||||
|
};
|
||||||
|
|
||||||
// Destroy the powertoy and free memory
|
// Destroy the powertoy and free memory
|
||||||
virtual void destroy() override {
|
virtual void destroy() override
|
||||||
delete this;
|
{
|
||||||
}
|
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<HINSTANCE>(&__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
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
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.
|
// Return array of the names of all events that this powertoy listens for, with
|
||||||
virtual void set_config(const wchar_t* config) override {
|
// nullptr as the last element of the array. Nullptr can also be retured for empty
|
||||||
try {
|
// list.
|
||||||
// Parse the input JSON string.
|
virtual const wchar_t** get_events() override
|
||||||
PowerToysSettings::PowerToyValues values =
|
{
|
||||||
PowerToysSettings::PowerToyValues::from_json_string(config);
|
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.
|
return events;
|
||||||
/*
|
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
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<HINSTANCE>(&__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
|
// Signal from the Settings editor to call a custom action.
|
||||||
virtual void enable() {
|
// This can be used to spawn more complex editors.
|
||||||
m_enabled = true;
|
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
|
//if (action_object.get_name() == L"custom_action_id") {
|
||||||
virtual void disable() {
|
// // Execute your custom action
|
||||||
m_enabled = false;
|
//}
|
||||||
}
|
}
|
||||||
|
catch (std::exception&)
|
||||||
// Returns if the powertoys is enabled
|
{
|
||||||
virtual bool is_enabled() override {
|
// Improper JSON.
|
||||||
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<LowlevelKeyboardEvent*>(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<WinHookEvent*>(data));
|
// Called by the runner to pass the updated settings values as a serialized JSON.
|
||||||
// Return value is ignored
|
virtual void set_config(const wchar_t* config) override
|
||||||
return 0;
|
{
|
||||||
|
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<LowlevelKeyboardEvent*>(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<WinHookEvent*>(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.
|
// Load the settings file.
|
||||||
void $safeprojectname$::init_settings() {
|
void $safeprojectname$::init_settings()
|
||||||
try {
|
{
|
||||||
// Load and parse the settings file for this PowerToy.
|
try
|
||||||
PowerToysSettings::PowerToyValues settings =
|
{
|
||||||
PowerToysSettings::PowerToyValues::load_from_settings_file($safeprojectname$::get_name());
|
// 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.
|
// Load a bool property.
|
||||||
/*
|
//if (auto v = settings.get_bool_value(L"bool_toggle_1")) {
|
||||||
if (settings.is_bool_value(L"bool_toggle_1")) {
|
// g_settings.bool_prop = *v;
|
||||||
g_settings.bool_prop = settings.get_bool_value(L"bool_toggle_1");
|
//}
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Load an int property.
|
// Load an int property.
|
||||||
/*
|
//if (auto v = settings.get_int_value(L"int_spinner_1")) {
|
||||||
if (settings.is_int_value(L"int_spinner_1")) {
|
// g_settings.int_prop = *v;
|
||||||
g_settings.int_prop = settings.get_int_value(L"int_spinner_1");
|
//}
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Load a string property.
|
// Load a string property.
|
||||||
/*
|
//if (auto v = settings.get_string_value(L"string_text_1")) {
|
||||||
if (settings.is_string_value(L"string_text_1")) {
|
// g_settings.string_prop = *v;
|
||||||
g_settings.string_prop = settings.get_string_value(L"string_text_1");
|
//}
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Load a color property.
|
// Load a color property.
|
||||||
/*
|
//if (auto v = settings.get_string_value(L"color_picker_1")) {
|
||||||
if (settings.is_string_value(L"color_picker_1")) {
|
// g_settings.color_prop = *v;
|
||||||
g_settings.color_prop = settings.get_string_value(L"color_picker_1");
|
//}
|
||||||
|
}
|
||||||
|
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
|
// 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.
|
// custom processing of the settings before saving them to disk.
|
||||||
/*
|
//void $projectname$::save_settings() {
|
||||||
void $projectname$::save_settings() {
|
// try {
|
||||||
try {
|
// // Create a PowerToyValues object for this PowerToy
|
||||||
// Create a PowerToyValues object for this PowerToy
|
// PowerToysSettings::PowerToyValues values(get_name());
|
||||||
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.
|
extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create()
|
||||||
//values.add_property(
|
{
|
||||||
// L"bool_toggle_1", // property name
|
return new $safeprojectname$();
|
||||||
// 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$();
|
|
||||||
}
|
|
@ -2,25 +2,28 @@
|
|||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
TRACELOGGING_DEFINE_PROVIDER(
|
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,
|
g_hProvider,
|
||||||
"PowerToyName::Event::MyEvent",
|
"Microsoft.PowerToys",
|
||||||
ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance),
|
// {38e8889b-9731-53f5-e901-e8a7c1753074}
|
||||||
TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"),
|
(0x38e8889b, 0x9731, 0x53f5, 0xe9, 0x01, 0xe8, 0xa7, 0xc1, 0x75, 0x30, 0x74),
|
||||||
TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE));
|
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));
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
class Trace {
|
class Trace
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
static void RegisterProvider();
|
static void RegisterProvider();
|
||||||
static void UnregisterProvider();
|
static void UnregisterProvider();
|
||||||
static void MyEvent();
|
static void MyEvent();
|
||||||
};
|
};
|
||||||
|
Binary file not shown.
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Installation
|
## 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.
|
- The template will be available in Visual Studio, when adding a new project, under the `Visual C++` tab.
|
||||||
|
|
||||||
## Create a new PowerToy Module
|
## Create a new PowerToy Module
|
||||||
|
Loading…
Reference in New Issue
Block a user