Upgrade to check-spelling v0.0.24 (#36235)

This upgrades to [v0.0.24](https://github.com/check-spelling/check-spelling/releases/tag/v0.0.24).

A number of GitHub APIs are being turned off shortly, so you need to upgrade or various uncertain outcomes will occur.

There's a new accessibility forbidden pattern:

> Do not use `(click) here` links
> For more information, see:
> * https://www.w3.org/QA/Tips/noClickHere
> * https://webaim.org/techniques/hypertext/link_text
> * https://granicus.com/blog/why-click-here-links-are-bad/
> * https://heyoka.medium.com/dont-use-click-here-f32f445d1021
```pl
(?i)(?:>|\[)(?:(?:click |)here|link|(?:read |)more)(?:</|\]\()
```

There are some minor bugs that I'm aware of and which I've fixed since this release, but I don't expect to make another release this month.

I've added a pair of patterns for includes and pragmas. My argument is that the **compiler** will _generally_ tell you if you've misspelled an include and the **linker** will _generally_ tell you if you misspell a lib.

- There's a caveat here: If your include case-insensitively matches the referenced file (but doesn't properly match it), then unless you either use a case-sensitive file system (as opposed to case-preserving) or beg clang to warn, you won't notice when you make this specific mistake -- this matters in that a couple of Windows headers (e.g. Unknwn.h) have particular case and repositories don't tend to consistently/properly write them.
This commit is contained in:
Josh Soref
2024-12-06 06:33:08 -10:00
committed by GitHub
parent 1212ce2216
commit 74a1a6eca2
84 changed files with 797 additions and 529 deletions

View File

@@ -157,7 +157,7 @@ private:
}
catch (const winrt::hresult_error& ex)
{
// Looks like the only way to access the PasswordVault is through the an API that throws an exception in case the resource doesn't exist.
// Looks like the only way to access the PasswordVault is through an API that throws an exception in case the resource doesn't exist.
// If the debugger breaks here, just continue.
// If you want to disable breaking here in a more permanent way, just add a condition in Visual Studio's Exception Settings to not break on win::hresult_error, but that might make you not hit other exceptions you might want to catch.
if (ex.code() == HRESULT_FROM_WIN32(ERROR_NOT_FOUND))

View File

@@ -275,7 +275,7 @@
<value>Add variable</value>
</data>
<data name="ProfileNotApplicableTitle" xml:space="preserve">
<value>Profile can not be applied.</value>
<value>Profile cannot be applied.</value>
</data>
<data name="StateProfileNotApplicableMsg" xml:space="preserve">
<value>Variables or backup variables are invalid.</value>

View File

@@ -4,7 +4,7 @@
#include <initguid.h>
#include <windows.h>
#include <unknwn.h>
#include <Unknwn.h>
#include <restrictederrorinfo.h>
#include <hstring.h>
#include <dxgi.h>

View File

@@ -21,7 +21,7 @@
#include <wrl.h>
#include <wrl/module.h>
#include <wrl/client.h>
#include <unknwn.h>
#include <Unknwn.h>
using namespace Microsoft::WRL;
// PowerToys project common

View File

@@ -20,7 +20,7 @@
#include <atlbase.h>
#include <wrl.h>
#include <wrl/module.h>
#include <unknwn.h>
#include <Unknwn.h>
// PowerToys project common
#include <ProjectTelemetry.h>

View File

@@ -10,7 +10,7 @@ namespace WorkspacesEditor.Utils
{
public static string UpperCamelCaseToDashCase(this string str)
{
// If it's single letter variable, leave it as it is
// If it's a single letter variable, leave it as it is
return str.Length == 1
? str
: string.Concat(str.Select((x, i) => i > 0 && char.IsUpper(x) ? "-" + x.ToString() : x.ToString())).ToLowerInvariant();

View File

@@ -10,7 +10,7 @@ namespace WorkspacesLauncherUI.Utils
{
public static string UpperCamelCaseToDashCase(this string str)
{
// If it's single letter variable, leave it as it is
// If it's a single letter variable, leave it as it is
if (str.Length == 1)
{
return str;

View File

@@ -1,5 +1,5 @@
#pragma once
extern UINT WM_PRIV_SETTINGS_CHANGED; // Scheduled when the a watched settings file is updated
extern UINT WM_PRIV_SETTINGS_CHANGED; // Scheduled when a watched settings file is updated
void InitializeWinhookEventIds();

View File

@@ -102,7 +102,7 @@ namespace ColorPicker.Views
private void HistoryColors_ItemClick(object sender, ItemClickEventArgs e)
{
// Note: it does not handle clicking on the same color.
// More appropriate event would be SelectionChanged but we can not distinguish between user action and program action inside of it.
// More appropriate event would be SelectionChanged but we cannot distinguish between user action and program action inside of it.
SessionEventHelper.Event.EditorHistoryColorPicked = true;
}
*/

View File

@@ -15,6 +15,6 @@ extern UINT WM_PRIV_APPLIED_LAYOUTS_FILE_UPDATE; // Scheduled when the watched a
extern UINT WM_PRIV_DEFAULT_LAYOUTS_FILE_UPDATE; // Scheduled when the watched default-layouts.json file is updated
extern UINT WM_PRIV_SNAP_HOTKEY; // Scheduled when we receive a snap hotkey key down press
extern UINT WM_PRIV_QUICK_LAYOUT_KEY; // Scheduled when we receive a key down press to quickly apply a layout
extern UINT WM_PRIV_SETTINGS_CHANGED; // Scheduled when the a watched settings file is updated
extern UINT WM_PRIV_SETTINGS_CHANGED; // Scheduled when a watched settings file is updated
void InitializeWinhookEventIds();

View File

@@ -197,7 +197,7 @@ namespace FancyZonesUnitTests
TEST_METHOD (ExcludedApp_ByUser)
{
// case sensitive, should be uppercase
// case-sensitive, should be uppercase
FancyZonesSettings::instance().SetSettings(Settings{ .excludedAppsArray = { L"TEST_EXCLUDED" } });
// exclude by window title

View File

@@ -24,7 +24,7 @@ namespace FancyZonesEditor
Logger.LogTrace();
// If new custom Canvas layout is created (i.e. edited Blank layout),
// it's type needs to be updated
// its type needs to be updated
if (EditingLayout.Type == LayoutType.Blank)
{
EditingLayout.Type = LayoutType.Custom;

View File

@@ -228,12 +228,12 @@ private:
if (UuidCreate(&temp_uuid) == RPC_S_UUID_NO_ADDRESS)
{
auto val = get_last_error_message(GetLastError());
Logger::warn(L"UuidCreate can not create guid. {}", val.has_value() ? val.value() : L"");
Logger::warn(L"UuidCreate cannot create guid. {}", val.has_value() ? val.value() : L"");
}
else if (UuidToString(&temp_uuid, reinterpret_cast<RPC_WSTR*>(& uuid_chars)) != RPC_S_OK)
{
auto val = get_last_error_message(GetLastError());
Logger::warn(L"UuidToString can not convert to string. {}", val.has_value() ? val.value() : L"");
Logger::warn(L"UuidToString cannot convert to string. {}", val.has_value() ? val.value() : L"");
}
if (uuid_chars != nullptr)

View File

@@ -8,7 +8,7 @@
#include <common/Telemetry/EtwTrace/EtwTrace.h>
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of its single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
#endif
using namespace ATL;

View File

@@ -430,7 +430,7 @@
<comment>Row as in horizontal rows in a table, and columns</comment>
</data>
<data name="ERRORMESSAGE_DISABLEASACTIONKEY" xml:space="preserve">
<value>Disable can not be an action or a modifier key</value>
<value>Disable cannot be an action or a modifier key</value>
<comment>Key on a keyboard</comment>
</data>
<data name="EditShortcuts_SourceHeader" xml:space="preserve">

View File

@@ -139,7 +139,7 @@ namespace BufferValidationHelpers
}
else if (selectedKeyCode == CommonSharedConstants::VK_DISABLED && dropDownIndex)
{
// Disable can not be selected if one modifier key has already been selected
// Disable cannot be selected if one modifier key has already been selected
errorType = ShortcutErrorType::ShortcutDisableAsActionKey;
}
// If none of the above, then the action key will be set

View File

@@ -500,7 +500,7 @@ LRESULT CALLBACK EditKeyboardWindowProc(HWND hWnd, UINT messageCode, WPARAM wPar
}
break;
default:
// If the Xaml Bridge object exists, then use it's message handler to handle keyboard focus operations
// If the Xaml Bridge object exists, then use its message handler to handle keyboard focus operations
if (xamlBridgePtr != nullptr)
{
return xamlBridgePtr->MessageHandler(messageCode, wParam, lParam);

View File

@@ -523,7 +523,7 @@ LRESULT CALLBACK EditShortcutsWindowProc(HWND hWnd, UINT messageCode, WPARAM wPa
}
break;
default:
// If the Xaml Bridge object exists, then use it's message handler to handle keyboard focus operations
// If the Xaml Bridge object exists, then use its message handler to handle keyboard focus operations
if (xamlBridgePtr != nullptr)
{
return xamlBridgePtr->MessageHandler(messageCode, wParam, lParam);

View File

@@ -3,7 +3,7 @@
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <unknwn.h>
#include <Unknwn.h>
#include <windows.h>
#include <shellapi.h>

View File

@@ -613,7 +613,7 @@ namespace KeyboardEventHandlers
if (!isAltRightKeyInvoked)
{
// Set original shortcut key down state except the action key and the released modifier since the original action key may or may not be held down. If it is held down it will generate it's own key message
// Set original shortcut key down state except the action key and the released modifier since the original action key may or may not be held down. If it is held down it will generate its own key message
Helpers::SetModifierKeyEvents(it->first, it->second.winKeyInvoked, keyEventList, true, KeyboardManagerConstants::KEYBOARDMANAGER_SHORTCUT_FLAG, std::get<Shortcut>(it->second.targetShortcut), data->lParam->vkCode);
}
else
@@ -637,7 +637,7 @@ namespace KeyboardEventHandlers
// Ensures that after releasing both the action key and AltGr, Ctrl does not remain falsely pressed.
if (!isAltRightKeyInvoked)
{
// Set original shortcut key down state except the action key and the released modifier since the original action key may or may not be held down. If it is held down it will generate it's own key message
// Set original shortcut key down state except the action key and the released modifier since the original action key may or may not be held down. If it is held down it will generate its own key message
Helpers::SetModifierKeyEvents(it->first, it->second.winKeyInvoked, keyEventList, true, KeyboardManagerConstants::KEYBOARDMANAGER_SHORTCUT_FLAG, Shortcut(), data->lParam->vkCode);
}
else
@@ -1711,7 +1711,7 @@ namespace KeyboardEventHandlers
query_string = process_name;
it = state.appSpecificShortcutReMap.find(query_string);
// If no entry is found, search for the process name without it's file extension
// If no entry is found, search for the process name without its file extension
if (it == state.appSpecificShortcutReMap.end())
{
// Find index of the file extension

View File

@@ -338,7 +338,7 @@ namespace Helpers
return key;
}
// Function to sort a vector of shortcuts based on it's size
// Function to sort a vector of shortcuts based on its size
void SortShortcutVectorBasedOnSize(std::vector<Shortcut>& shortcutVector)
{
std::sort(shortcutVector.begin(), shortcutVector.end(), [](Shortcut first, Shortcut second) {

View File

@@ -52,6 +52,6 @@ namespace Helpers
// Function to filter the key codes for artificial key codes
int32_t FilterArtificialKeys(const int32_t& key);
// Function to sort a vector of shortcuts based on it's size
// Function to sort a vector of shortcuts based on its size
void SortShortcutVectorBasedOnSize(std::vector<Shortcut>& shortcutVector);
}

View File

@@ -21,7 +21,7 @@ std::vector<std::wstring> Shortcut::splitwstring(const std::wstring& input, wcha
return splittedStrings;
}
// Constructor to initialize Shortcut from it's virtual key code string representation.
// Constructor to initialize Shortcut from its virtual key code string representation.
Shortcut::Shortcut(const std::wstring& shortcutVK) :
winKey(ModifierKey::Disabled), ctrlKey(ModifierKey::Disabled), altKey(ModifierKey::Disabled), shiftKey(ModifierKey::Disabled), actionKey(NULL)
{
@@ -46,7 +46,7 @@ Shortcut::Shortcut(const DWORD key)
SetKey(key);
}
// Constructor to initialize Shortcut from it's virtual key code string representation.
// Constructor to initialize Shortcut from its virtual key code string representation.
Shortcut::Shortcut(const std::wstring& shortcutVK, const DWORD secondKeyOfChord) :
winKey(ModifierKey::Disabled), ctrlKey(ModifierKey::Disabled), altKey(ModifierKey::Disabled), shiftKey(ModifierKey::Disabled), actionKey(NULL)
{

View File

@@ -82,10 +82,10 @@ public:
// Constructor to initialize Shortcut from single key
Shortcut(const DWORD key);
// Constructor to initialize Shortcut from it's virtual key code string representation.
// Constructor to initialize Shortcut from its virtual key code string representation.
Shortcut(const std::wstring& shortcutVK);
// Constructor to initialize Shortcut from it's virtual key code string representation.
// Constructor to initialize Shortcut from its virtual key code string representation.
Shortcut(const std::wstring& shortcutVK, const DWORD _secondKeyOfChord);
// Constructor to initialize shortcut from a list of keys

View File

@@ -163,7 +163,7 @@ namespace Microsoft.Plugin.Indexer
};
r.ContextData = searchResult;
// If the result is a directory, then it's display should show a directory.
// If the result is a directory, then its display should show a directory.
if (_fileSystem.Directory.Exists(path))
{
r.QueryTextDisplay = path;

View File

@@ -252,10 +252,10 @@ namespace Microsoft.Plugin.Program.Programs
logoUri = LogoUriFromManifest(manifestApp);
Enabled = true;
CanRunElevated = IfApplicationcanRunElevated();
CanRunElevated = IfApplicationCanRunElevated();
}
private bool IfApplicationcanRunElevated()
private bool IfApplicationCanRunElevated()
{
if (EntryPoint == "Windows.FullTrustApplication")
{

View File

@@ -132,7 +132,7 @@ namespace Microsoft.Plugin.Uri.UnitTests.UriHelper
// All following cases should be parsed as application URI
[DataRow("mailto:", true, null, "mailto:")]
[DataRow("mailto:/", false, null, null)]
[DataRow("mailto:example@mail.com", true, null, "mailto:example@mail.com")]
[DataRow("mailto:mail@example.com", true, null, "mailto:mail@example.com")]
[DataRow("ms-settings:", true, null, "ms-settings:")]
[DataRow("ms-settings:/", false, null, null)]
[DataRow("ms-settings://", false, null, null)]

View File

@@ -39,7 +39,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
{
if (!windowData.IsWindow)
{
Log.Debug($"Can not close the window '{windowData.Title}' ({windowData.Hwnd}), because it doesn't exist.", typeof(ContextMenuHelper));
Log.Debug($"Cannot close the window '{windowData.Title}' ({windowData.Hwnd}), because it doesn't exist.", typeof(ContextMenuHelper));
return false;
}
@@ -79,7 +79,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
// Validate process
if (!window.IsWindow || !window.Process.DoesExist || !window.Process.Name.Equals(WindowProcess.GetProcessNameFromProcessID(window.Process.ProcessID), StringComparison.Ordinal))
{
Log.Debug($"Can not kill process '{window.Process.Name}' ({window.Process.ProcessID}) of the window '{window.Title}' ({window.Hwnd}), because it doesn't exist.", typeof(ContextMenuHelper));
Log.Debug($"Cannot kill process '{window.Process.Name}' ({window.Process.ProcessID}) of the window '{window.Title}' ({window.Hwnd}), because it doesn't exist.", typeof(ContextMenuHelper));
return false;
}

View File

@@ -363,7 +363,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
{
if (_handlesToProcessCache.Count > 7000)
{
Debug.Print("Clearing Process Cache because it's size is " + _handlesToProcessCache.Count);
Debug.Print("Clearing Process Cache because its size is " + _handlesToProcessCache.Count);
_handlesToProcessCache.Clear();
}
@@ -381,7 +381,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
}
else
{
// For the dwm process we can not receive the name. This is no problem because the window isn't part of result list.
// For the dwm process we cannot receive the name. This is no problem because the window isn't part of result list.
Log.Debug($"Invalid process {processId} ({processName}) for window handle {hWindow}.", typeof(Window));
_handlesToProcessCache.Add(hWindow, new WindowProcess(0, 0, string.Empty));
}

View File

@@ -203,7 +203,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
}
/// <summary>
/// Kills the process by it's id. If permissions are required, they will be requested.
/// Kills the process by its id. If permissions are required, they will be requested.
/// </summary>
/// <param name="killProcessTree">Kill process and sub processes.</param>
internal void KillThisProcess(bool killProcessTree)

View File

@@ -20,7 +20,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Components
internal string Label { get; set; }
/// <summary>
/// Gets or sets an an alternative search tag that will be evaluated if label doesn't match. For example we like to show the era on searches for 'year' too.
/// Gets or sets an alternative search tag that will be evaluated if label doesn't match. For example we like to show the era on searches for 'year' too.
/// </summary>
internal string AlternativeSearchTag { get; set; }

View File

@@ -15,7 +15,7 @@ using Stopwatch = Wox.Infrastructure.Stopwatch;
namespace PowerLauncher.Helper
{
/// <Note>
/// On Windows operating system the name of environment variables is case insensitive. This means if we have a user and machine variable with differences in their name casing (eg. test vs Test), the name casing from machine level is used and won't be overwritten by the user var.
/// On Windows operating system the name of environment variables is case-insensitive. This means if we have a user and machine variable with differences in their name casing (eg. test vs Test), the name casing from machine level is used and won't be overwritten by the user var.
/// Example for Window's behavior: test=ValueMachine (Machine level) + TEST=ValueUser (User level) => test=ValueUser (merged)
/// To get the same behavior we use "StringComparer.OrdinalIgnoreCase" as compare property for the HashSet and Dictionaries where we merge machine and user variable names.
/// </Note>
@@ -96,7 +96,7 @@ namespace PowerLauncher.Helper
// Determine deleted variables and add them with a "string.Empty" value as marker to the dictionary
foreach (DictionaryEntry pVar in oldProcessEnvironment)
{
// We must compare case insensitive (see dictionary assignment) to avoid false positives when the variable name has changed (Example: "path" -> "Path")
// We must compare case-insensitive (see dictionary assignment) to avoid false positives when the variable name has changed (Example: "path" -> "Path")
if (!newEnvironment.ContainsKey((string)pVar.Key) & !_protectedProcessVariables.Contains((string)pVar.Key))
{
newEnvironment.Add((string)pVar.Key, string.Empty);
@@ -107,7 +107,7 @@ namespace PowerLauncher.Helper
// Later we only like to recreate the changed ones
foreach (string varName in newEnvironment.Keys.ToList())
{
// To be able to detect changed names correctly we have to compare case sensitive
// To be able to detect changed names correctly we have to compare case-sensitive
if (oldProcessEnvironment.Contains(varName))
{
if (oldProcessEnvironment[varName].Equals(newEnvironment[varName]))
@@ -155,7 +155,7 @@ namespace PowerLauncher.Helper
}
catch (Exception ex)
{
// The dotnet method "System.Environment.SetEnvironmentVariable" has it's own internal method to check the input parameters. Here we catch the exceptions that we don't check before updating the environment variable and log it to avoid crashes of PT Run.
// The dotnet method "System.Environment.SetEnvironmentVariable" has its own internal method to check the input parameters. Here we catch the exceptions that we don't check before updating the environment variable and log it to avoid crashes of PT Run.
Log.Exception($"Unhandled exception while updating the environment variable [{kv.Key}] for the PT Run process. (The variable value has a length of [{varValueLength}].)", ex, typeof(PowerLauncher.Helper.EnvironmentHelper));
}
}
@@ -189,7 +189,7 @@ namespace PowerLauncher.Helper
string uVarKey = (string)uVar.Key;
string uVarValue = (string)uVar.Value;
// The variable name of the path variable can be upper case, lower case ore mixed case. So we have to compare case insensitive.
// The variable name of the path variable can be upper case, lower case ore mixed case. So we have to compare case-insensitive.
if (!uVarKey.Equals(PathVariableName, StringComparison.OrdinalIgnoreCase))
{
environment[uVarKey] = uVarValue;

View File

@@ -617,7 +617,7 @@ namespace PowerLauncher
catch (ArgumentOutOfRangeException ex)
{
// Due to virtualization being enabled for the listview, the layout system updates elements in a deferred manner using an algorithm that balances performance and concurrency.
// Hence, there can be a situation where the element index that we want to scroll into view is out of range for it's parent control.
// Hence, there can be a situation where the element index that we want to scroll into view is out of range for its parent control.
// To mitigate this we use the UpdateLayout function, which forces layout update to ensure that the parent element contains the latest properties.
// However, it has a performance impact and is therefore not called each time.
Log.Exception("The parent element layout is not updated yet", ex, GetType());

View File

@@ -91,7 +91,7 @@ namespace Wox.Plugin.Common.VirtualDesktop.Helper
/// Method to update the list of Virtual Desktops from Registry
/// The data in the registry are always up to date
/// </summary>
/// <remarks>If we can not read from registry, we set the list/guid to empty values.</remarks>
/// <remarks>If we cannot read from registry, we set the list/guid to empty values.</remarks>
public void UpdateDesktopList()
{
int userSessionId = Process.GetCurrentProcess().SessionId;

View File

@@ -223,7 +223,7 @@ namespace Wox.Plugin
{
if (Plugin == null)
{
Log.Warn($"Can not initialize {Metadata.Name} plugin as it was not loaded", GetType());
Log.Warn($"Cannot initialize {Metadata.Name} plugin as it was not loaded", GetType());
return false;
}

View File

@@ -1,4 +1,4 @@
#pragma once
#include <unknwn.h>
#include <Unknwn.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>

View File

@@ -218,12 +218,12 @@ private:
if (UuidCreate(&temp_uuid) == RPC_S_UUID_NO_ADDRESS)
{
auto val = get_last_error_message(GetLastError());
Logger::warn(L"UuidCreate can not create guid. {}", val.has_value() ? val.value() : L"");
Logger::warn(L"UuidCreate cannot create guid. {}", val.has_value() ? val.value() : L"");
}
else if (UuidToString(&temp_uuid, reinterpret_cast<RPC_WSTR*>(& uuid_chars)) != RPC_S_OK)
{
auto val = get_last_error_message(GetLastError());
Logger::warn(L"UuidToString can not convert to string. {}", val.has_value() ? val.value() : L"");
Logger::warn(L"UuidToString cannot convert to string. {}", val.has_value() ? val.value() : L"");
}
if (uuid_chars != nullptr)

View File

@@ -3,10 +3,10 @@
#define NOMINMAX
#include <windows.h>
#include <unknwn.h>
#include <Unknwn.h>
#include <restrictederrorinfo.h>
#include <hstring.h>
#include <unknwn.h>
#include <Unknwn.h>
// Undefine GetCurrentTime macro to prevent
// conflict with Storyboard::GetCurrentTime

View File

@@ -8,7 +8,7 @@
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <windows.h>
#include <unknwn.h>
#include <Unknwn.h>
#include <shlwapi.h>
#include <atlbase.h>
#include <atlcom.h>

View File

@@ -19,7 +19,7 @@ To add a new Previewer update the `Product.wxs` file in `PowerToysSetup` similar
**[Important] This method of registering Preview Handler DLL's is not recommended. It could lead to registry corruption.**
#### Registering Preview Handler
1. Restart Visual studio as administrator.
2. Sign `XYZPreviewHandler` and it's dependencies. To sign an assembly in VS, follow steps given [here](https://learn.microsoft.com/dotnet/standard/assembly/sign-strong-name#create-and-sign-an-assembly-with-a-strong-name-by-using-visual-studio).
2. Sign `XYZPreviewHandler` and its dependencies. To sign an assembly in VS, follow steps given [Create and sign an assembly with a strong name by using Visual Studio](https://learn.microsoft.com/en-us/dotnet/standard/assembly/sign-strong-name#create-and-sign-an-assembly-with-a-strong-name-by-using-visual-studio).
3. Build `XYZPreviewHandler` project.
4. Open developer command prompt from `Tools > Command Line > Developer Command Prompt`.
5. Run following command for each nuget and project dependency to add them to Global Assembly Cache(GAC).

View File

@@ -52,9 +52,9 @@ STRINGTABLE
BEGIN
IDS_EXPLR_ICONS_PREV_STTNGS_GROUP_HEADER_ID L"EXPLR_ICONS_PREV_STTNGS_GROUP_HEADER_ID"
IDS_PRVPANE_FILE_PREV_STTNGS_GROUP_HEADER_ID L"PRVPANE_FILE_PREV_STTNGS_GROUP_HEADER_ID"
IDS_PREVPANE_MD_BOOL_TOGGLE_CONTROLL L"PREVPANE_MD_BOOL_TOGGLE_CONTROLL_ID"
IDS_PREVPANE_SVG_BOOL_TOGGLE_CONTROLL L"IDS_PREVPANE_SVG_BOOL_TOGGLE_CONTROLL"
IDS_EXPLR_SVG_BOOL_TOGGLE_CONTROLL L"EXPLR_SVG_BOOL_TOGGLE_CONTROLL"
IDS_PREVPANE_MD_BOOL_TOGGLE_CONTROL L"PREVPANE_MD_BOOL_TOGGLE_CONTROLL_ID"
IDS_PREVPANE_SVG_BOOL_TOGGLE_CONTROL L"IDS_PREVPANE_SVG_BOOL_TOGGLE_CONTROL"
IDS_EXPLR_SVG_BOOL_TOGGLE_CONTROL L"EXPLR_SVG_BOOL_TOGGLE_CONTROLL"
END
// Non-localizable

View File

@@ -10,9 +10,9 @@
#define ORIGINAL_FILENAME "PowerToys.powerpreview.dll"
#define IDS_EXPLR_ICONS_PREV_STTNGS_GROUP_HEADER_ID 1001
#define IDS_PRVPANE_FILE_PREV_STTNGS_GROUP_HEADER_ID 1002
#define IDS_PREVPANE_MD_BOOL_TOGGLE_CONTROLL 1003
#define IDS_PREVPANE_SVG_BOOL_TOGGLE_CONTROLL 1004
#define IDS_EXPLR_SVG_BOOL_TOGGLE_CONTROLL 1005
#define IDS_PREVPANE_MD_BOOL_TOGGLE_CONTROL 1003
#define IDS_PREVPANE_SVG_BOOL_TOGGLE_CONTROL 1004
#define IDS_EXPLR_SVG_BOOL_TOGGLE_CONTROL 1005
// Non-localizable
//////////////////////////////

View File

@@ -196,7 +196,7 @@ namespace RegistryPreviewUILib
return false;
}
// REG files have to start with one of two headers and it's case insensitive
// REG files have to start with one of two headers and it's case-insensitive
registryLine = registryLines[0];
registryLine = registryLine.ToLowerInvariant();
@@ -232,7 +232,7 @@ namespace RegistryPreviewUILib
}
else if (registryLine.StartsWith("@=", StringComparison.InvariantCulture))
{
// This is the a Value called "(Default)" so we tweak the line for the UX
// This is the Value called "(Default)" so we tweak the line for the UX
registryLine = registryLine.Replace("@=", "\"(Default)\"=");
}