[New utility]Sysinternals ZoomIt (#35880)

* ZoomIt initial code dump

* Change vcxproj to normalize dependency versions

* Fix code quality to build

* Add to PowerToys solution

* Clean out C-style casts

* Fix some more analyzer errors

* Constexpr a function

* Disable some warnings locally that it seemed better not to touch

* Add ZoomIt module interface

* Add GPO

* Add Settings page with Enable button

* Output as PowerToys.ZoomIt.exe

* Extract ZoomIt Settings definition to its own header

* Make ZoomItModuleInterface build with ZoomItSettings too

* WinRT C++ interop for ZoomItSettings

* From Registry To PowerToys Json

* Properly fix const_cast analyzer error

* Initial Settings page loading from registry

* Zoom mode settings

* Save settings

* Add file picker and DemoType file support

* Remaining DemoType settings

* Have ZoomIt properly reloading Settings and exiting

* Remove context menu entries for Options and Exit

* ZoomIt simple Break Options

* Break advanced options

* Simple Record settings

* Record Microphone setting

* Fix break background file picker title

* Font setting

* Fix build issues after merge

* Add ZoomIt conflict warning to Settings

* Exclude Eula from spell checking

* Fix spellcheck errors

* Fix spell check for accelerated menu items

* Remove cursor files from spellcheck. They're binary

* Fix forbidden patterns

* Fix XAML style

* Fix C# analyzers

* Fix signing

* Also sign module interface dll

* Use actual ZoomIt icon

* Add OOBE page for ZoomIt

* ZoomIt image for Settings

* Flyout and Dashboard entries

* Fix type speed slider labels

* Correctly load default Font

* Correctly register shortcuts on ZoomIt startup first run

* Fix modifier keys not changing until restart

* Show MsgBox on taken shortcut

* Start PowerToys Settings

* Normalize ZoomIt file properties with rest of PowerToys

* Add attribution

* Add ZoomIt team to Community.md

* More copyright adjustments

* Fix spellcheck

* Fix MsgBox simultaneous instance to the front

* Add mention of capturevideosample code use

* Add ZoomIt to process lists

* Add telemetry

* Add logging

* React to gpo

* Normalize code to space identation

* Fix installer build

* Localize percent setting

* Fix XAML styling

* Update src/settings-ui/Settings.UI/Strings/en-us/Resources.resw

Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com>

* Fix spellcheck

* One more spellcheck fix

* Integrate LiveDraw feature changes from upstream

* Fix name reuse in same scope

* Fix c-style casts

* Also register LIVEDRAW_HOTKEY

* Fix newLiveZoomToggleKey

* Update LiveZoom description in Settings to take LiveDraw into account

* Fix spellcheck

* Fix more spellcheck

* Fix Sysinternals capitalization

* Fix ARM64 Debug build

* Support Sysinternals build (#36873)

* Remove unneeded files

* Make build compatible with Sysinternals

* Separate PowerToys ZoomIt product name (#36887)

* Separate PowerToys ZoomIt product name

To help maintain the Sysinternals branding in the standalone version.

* Clarify branding-related includes

* Remove ZoomIt.sln

* Add foxmsft to spell-check names

* Add ZoomIt to README

* Add ZoomIt to GH templates

* Add ZoomIt events to DATA_AND_PRIVACY.md

* Remove publish_config.json

* Remove publish_config.json from vcxproj too

---------

Co-authored-by: Mark Russinovich <markruss@microsoft.com>
Co-authored-by: Alex Mihaiuc <69110671+foxmsft@users.noreply.github.com>
Co-authored-by: John Stephens <johnstep@microsoft.com>
Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com>
This commit is contained in:
Jaime Bernardo
2025-01-16 20:52:24 +00:00
committed by GitHub
parent 65e09dbed7
commit 21fd5092b3
123 changed files with 17201 additions and 20 deletions

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<!--
To customize common C++/WinRT project properties:
* right-click the project node
* expand the Common Properties item
* select the C++/WinRT property page
For more advanced scenarios, and complete documentation, please see:
https://github.com/Microsoft/cppwinrt/tree/master/nuget
-->
<PropertyGroup />
<ItemDefinitionGroup />
</Project>

View File

@@ -0,0 +1,274 @@
#include "pch.h"
#include "ZoomItSettings.h"
#include "ZoomItSettings.g.cpp"
#include "../ZoomIt/ZoomItSettings.h"
#include <common/SettingsAPI/settings_objects.h>
#include <common/utils/color.h>
#include <map>
#pragma comment(lib, "Crypt32.lib") // For the CryptStringToBinaryW and CryptBinaryToStringW functions
namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
{
ClassRegistry reg(_T("Software\\Sysinternals\\") APPNAME);
const unsigned int SPECIAL_SEMANTICS_SHORTCUT = 1;
const unsigned int SPECIAL_SEMANTICS_COLOR = 2;
const unsigned int SPECIAL_SEMANTICS_LOG_FONT = 3;
std::vector<unsigned char> base64_decode(const std::wstring& base64_string)
{
DWORD binary_len = 0;
// Get the required buffer size for the binary data
if (!CryptStringToBinaryW(base64_string.c_str(), 0, CRYPT_STRING_BASE64, nullptr, &binary_len, nullptr, nullptr))
{
throw std::runtime_error("Error in CryptStringToBinaryW (getting size)");
}
std::vector<unsigned char> binary_data(binary_len);
// Decode the Base64 string into binary data
if (!CryptStringToBinaryW(base64_string.c_str(), 0, CRYPT_STRING_BASE64, binary_data.data(), &binary_len, nullptr, nullptr))
{
throw std::runtime_error("Error in CryptStringToBinaryW (decoding)");
}
return binary_data;
}
std::wstring base64_encode(const unsigned char* data, size_t length)
{
DWORD base64_len = 0;
// Get the required buffer size for Base64 string
if (!CryptBinaryToStringW(data, static_cast<DWORD>(length), CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, nullptr, &base64_len))
{
throw std::runtime_error("Error in CryptBinaryToStringW (getting size)");
}
std::wstring base64_string(base64_len, '\0');
// Encode the binary data to Base64
if (!CryptBinaryToStringW(data, static_cast<DWORD>(length), CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, &base64_string[0], &base64_len))
{
throw std::runtime_error("Error in CryptBinaryToStringW (encoding)");
}
// Resize the wstring to remove any trailing null character.
if (!base64_string.empty() && base64_string.back() == L'\0')
{
base64_string.pop_back();
}
return base64_string;
}
std::map<std::wstring, unsigned int> settings_with_special_semantics = {
{ L"ToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"LiveZoomToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"DrawToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"RecordToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"SnipToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"BreakTimerKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"DemoTypeToggleKey", SPECIAL_SEMANTICS_SHORTCUT },
{ L"PenColor", SPECIAL_SEMANTICS_COLOR },
{ L"BreakPenColor", SPECIAL_SEMANTICS_COLOR },
{ L"Font", SPECIAL_SEMANTICS_LOG_FONT },
};
hstring ZoomItSettings::LoadSettingsJson()
{
PowerToysSettings::PowerToyValues _settings(L"ZoomIt",L"ZoomIt");
reg.ReadRegSettings(RegSettings);
PREG_SETTING curSetting = RegSettings;
while (curSetting->ValueName)
{
switch (curSetting->Type)
{
case SETTING_TYPE_DWORD:
{
auto special_semantics = settings_with_special_semantics.find(curSetting->ValueName);
DWORD value = *static_cast<PDWORD>(curSetting->Setting);
if (special_semantics == settings_with_special_semantics.end())
{
_settings.add_property<DWORD>(curSetting->ValueName, value);
}
else
{
if (special_semantics->second == SPECIAL_SEMANTICS_SHORTCUT)
{
auto hotkey = PowerToysSettings::HotkeyObject::from_settings(
value & (HOTKEYF_EXT << 8), //WIN
value & (HOTKEYF_CONTROL << 8),
value & (HOTKEYF_ALT << 8),
value & (HOTKEYF_SHIFT << 8),
value & 0xFF);
_settings.add_property(curSetting->ValueName, hotkey.get_json());
}
else if (special_semantics->second == SPECIAL_SEMANTICS_COLOR)
{
// PowerToys settings likes colors as #FFFFFF strings.
hstring s = winrt::to_hstring(std::format("#{:02x}{:02x}{:02x}", value & 0xFF, (value >> 8) & 0xFF, (value >> 16) & 0xFF));
_settings.add_property(curSetting->ValueName, s);
}
}
break;
}
case SETTING_TYPE_BOOLEAN:
_settings.add_property<bool>(curSetting->ValueName, *static_cast<PBOOLEAN>(curSetting->Setting));
break;
case SETTING_TYPE_DOUBLE:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_WORD:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_STRING:
_settings.add_property<std::wstring>(curSetting->ValueName, static_cast<PTCHAR>(curSetting->Setting));
break;
case SETTING_TYPE_DWORD_ARRAY:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_WORD_ARRAY:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_BINARY:
auto special_semantics = settings_with_special_semantics.find(curSetting->ValueName);
if (special_semantics != settings_with_special_semantics.end() && special_semantics->second == SPECIAL_SEMANTICS_LOG_FONT)
{
// This is the font setting. It's a special case where the default value needs to be calculated if it's still 0.
if (g_LogFont.lfFaceName[0] == L'\0')
{
GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof g_LogFont, &g_LogFont);
g_LogFont.lfWeight = FW_NORMAL;
auto hDc = CreateCompatibleDC(NULL);
g_LogFont.lfHeight = -MulDiv(8, GetDeviceCaps(hDc, LOGPIXELSY), 72);
DeleteDC(hDc);
}
}
// Base64 encoding is likely the best way to serialize a byte array into JSON.
auto encodedFont = base64_encode(static_cast<PBYTE>(curSetting->Setting), curSetting->Size);
_settings.add_property<std::wstring>(curSetting->ValueName, encodedFont);
break;
}
curSetting++;
}
return _settings.get_raw_json().Stringify();
}
void ZoomItSettings::SaveSettingsJson(hstring json)
{
reg.ReadRegSettings(RegSettings);
// Parse the input JSON string.
PowerToysSettings::PowerToyValues valuesFromSettings =
PowerToysSettings::PowerToyValues::from_json_string(json, L"ZoomIt");
PREG_SETTING curSetting = RegSettings;
while (curSetting->ValueName)
{
switch (curSetting->Type)
{
case SETTING_TYPE_DWORD:
{
auto special_semantics = settings_with_special_semantics.find(curSetting->ValueName);
if (special_semantics == settings_with_special_semantics.end())
{
auto possibleValue = valuesFromSettings.get_uint_value(curSetting->ValueName);
if (possibleValue.has_value())
{
*static_cast<PDWORD>(curSetting->Setting) = possibleValue.value();
}
}
else
{
if (special_semantics->second == SPECIAL_SEMANTICS_SHORTCUT)
{
auto possibleValue = valuesFromSettings.get_json(curSetting->ValueName);
if (possibleValue.has_value())
{
auto hotkey = PowerToysSettings::HotkeyObject::from_json(possibleValue.value());
unsigned int value = 0;
value |= hotkey.get_code();
if (hotkey.ctrl_pressed())
{
value |= (HOTKEYF_CONTROL << 8);
}
if (hotkey.alt_pressed())
{
value |= (HOTKEYF_ALT << 8);
}
if (hotkey.shift_pressed())
{
value |= (HOTKEYF_SHIFT << 8);
}
if (hotkey.win_pressed())
{
value |= (HOTKEYF_EXT << 8);
}
*static_cast<PDWORD>(curSetting->Setting) = value;
}
}
else if (special_semantics->second == SPECIAL_SEMANTICS_COLOR)
{
auto possibleValue = valuesFromSettings.get_string_value(curSetting->ValueName);
if (possibleValue.has_value())
{
uint8_t r, g, b;
if (checkValidRGB(possibleValue.value(), &r, &g, &b))
{
*static_cast<PDWORD>(curSetting->Setting) = RGB(r, g, b);
}
}
}
}
break;
}
case SETTING_TYPE_BOOLEAN:
{
auto possibleValue = valuesFromSettings.get_bool_value(curSetting->ValueName);
if (possibleValue.has_value())
{
*static_cast<PBOOLEAN>(curSetting->Setting) = static_cast<BOOLEAN>(possibleValue.value());
}
break;
}
case SETTING_TYPE_DOUBLE:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_WORD:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_STRING:
{
auto possibleValue = valuesFromSettings.get_string_value(curSetting->ValueName);
if (possibleValue.has_value())
{
const TCHAR* value = possibleValue.value().c_str();
_tcscpy_s(static_cast<PTCHAR>(curSetting->Setting), curSetting->Size / sizeof(TCHAR), value);
}
break;
}
case SETTING_TYPE_DWORD_ARRAY:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_WORD_ARRAY:
assert(false); // ZoomIt doesn't use this type of setting.
break;
case SETTING_TYPE_BINARY:
auto possibleValue = valuesFromSettings.get_string_value(curSetting->ValueName);
if (possibleValue.has_value())
{
// Base64 encoding is likely the best way to serialize a byte array into JSON.
auto decodedValue = base64_decode(possibleValue.value());
assert(curSetting->Size == decodedValue.size()); // Should right now only be used for LOGFONT, so let's hard check it to avoid any insecure overflows.
memcpy(static_cast<PBYTE>(curSetting->Setting), decodedValue.data(), decodedValue.size());
}
break;
}
curSetting++;
}
reg.WriteRegSettings(RegSettings);
}
}

View File

@@ -0,0 +1,20 @@
#pragma once
#include "ZoomItSettings.g.h"
namespace winrt::PowerToys::ZoomItSettingsInterop::implementation
{
struct ZoomItSettings : ZoomItSettingsT<ZoomItSettings>
{
ZoomItSettings() = default;
static hstring LoadSettingsJson();
static void SaveSettingsJson(hstring json);
};
}
namespace winrt::PowerToys::ZoomItSettingsInterop::factory_implementation
{
struct ZoomItSettings : ZoomItSettingsT<ZoomItSettings, implementation::ZoomItSettings>
{
};
}

View File

@@ -0,0 +1,10 @@
namespace PowerToys
{
namespace ZoomItSettingsInterop
{
[default_interface] static runtimeclass ZoomItSettings {
static String LoadSettingsJson();
static void SaveSettingsJson(String json);
}
}
}

View File

@@ -0,0 +1,3 @@
EXPORTS
DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE

View File

@@ -0,0 +1,40 @@
#include <windows.h>
#include "resource.h"
#include "../../../common/version/version.h"
#define APSTUDIO_READONLY_SYMBOLS
#include "winres.h"
#undef APSTUDIO_READONLY_SYMBOLS
1 VERSIONINFO
FILEVERSION FILE_VERSION
PRODUCTVERSION PRODUCT_VERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION
VALUE "FileVersion", FILE_VERSION_STRING
VALUE "InternalName", INTERNAL_NAME
VALUE "LegalCopyright", COPYRIGHT_NOTE
VALUE "OriginalFilename", ORIGINAL_FILENAME
VALUE "ProductName", PRODUCT_NAME
VALUE "ProductVersion", PRODUCT_VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
END
END

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
<MinimalCoreWin>true</MinimalCoreWin>
<ProjectGuid>{ca7d8106-30B9-4aec-9d05-b69b31b8c461}</ProjectGuid>
<ProjectName>ZoomItSettingsInterop</ProjectName>
<RootNamespace>PowerToys.ZoomItSettingsInterop</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>false</AppContainerApplication>
<AppxPackage>false</AppxPackage>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="PropertySheet.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<TargetName>PowerToys.ZoomItSettingsInterop</TargetName>
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
<PreprocessorDefinitions>_WINRT_DLL;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<ModuleDefinitionFile>ZoomItSettingsInterop.def</ModuleDefinitionFile>
<AdditionalDependencies>Shell32.lib;gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="ZoomItSettings.h">
<DependentUpon>ZoomItSettings.idl</DependentUpon>
</ClInclude>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ZoomItSettings.cpp">
<DependentUpon>ZoomItSettings.idl</DependentUpon>
</ClCompile>
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<Midl Include="ZoomItSettings.idl" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="ZoomItSettingsInterop.def" />
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\common\logger\logger.vcxproj">
<Project>{d9b8fc84-322a-4f9f-bbb9-20915c47ddfd}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\common\SettingsAPI\SettingsAPI.vcxproj">
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZoomItSettingsInterop.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\..\..\..\deps\spdlog.props" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
</Target>
</Project>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resources">
<UniqueIdentifier>{de682ddf-17ab-471d-9761-82b42e6baa70}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Generated Files">
<UniqueIdentifier>{c02d42a3-682e-499a-8b28-638a0802d43f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<Midl Include="ZoomItSettings.idl" />
</ItemGroup>
<ItemGroup>
<None Include="ZoomItSettingsInterop.def" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="PropertySheet.props" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ZoomItSettingsInterop.rc">
<Filter>Resources</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.231216.1" targetFramework="native" />
</packages>

View File

@@ -0,0 +1 @@
#include "pch.h"

View File

@@ -0,0 +1,22 @@
#pragma once
#include <windows.h>
#include <commctrl.h>
#include <tchar.h>
#include <magnification.h>
#include <shellapi.h>
#define GDIPVER 0x0110
#include <gdiplus.h>
// DirectX
#include <d3d11_4.h>
#include <dxgi1_6.h>
#include <d2d1_3.h>
// Must come before C++/WinRT
#include <wil/cppwinrt.h>
#include <unknwn.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>

View File

@@ -0,0 +1,13 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ZoomItSettingsInterop.rc
//////////////////////////////
// Non-localizable
#define FILE_DESCRIPTION "PowerToys ZoomItSettingsInterop"
#define INTERNAL_NAME "PowerToys.ZoomItSettingsInterop"
#define ORIGINAL_FILENAME "PowerToys.ZoomItSettingsInterop.dll"
// Non-localizable
//////////////////////////////