// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #nullable enable using System; namespace autoShell.Services; /// /// Abstracts SystemParametersInfo and related Win32 system parameter calls for testability. /// internal interface ISystemParametersService { /// /// Sets a system parameter via SystemParametersInfo with an IntPtr value. /// /// The system parameter action constant (SPI_SET*). /// Additional parameter whose meaning depends on the action. /// Pointer to the value to set. /// Flags controlling persistence and notification (SPIF_*). bool SetParameter(int action, int param, IntPtr vparam, int flags); /// /// Sets a system parameter via SystemParametersInfo with a string value. /// /// The system parameter action constant (SPI_SET*). /// Additional parameter whose meaning depends on the action. /// The string value to set. /// Flags controlling persistence and notification (SPIF_*). bool SetParameter(int action, int param, string vparam, int flags); /// /// Sets a system parameter via SystemParametersInfo with an int array value. /// /// The system parameter action constant (SPI_SET*). /// Additional parameter whose meaning depends on the action. /// Array containing the value to set. /// Flags controlling persistence and notification (SPIF_*). bool SetParameter(int action, int param, int[] vparam, int flags); /// /// Gets a system parameter via SystemParametersInfo into an int array. /// /// The system parameter action constant (SPI_GET*). /// Additional parameter whose meaning depends on the action. /// Array to receive the value. /// Flags (typically 0 for get operations). bool GetParameter(int action, int param, int[] vparam, int flags); /// /// Swaps the primary and secondary mouse buttons. /// /// If true, swaps the buttons; if false, restores default. bool SwapMouseButton(bool swap); /// /// Enables or disables Filter Keys via SystemParametersInfo(SPI_SETFILTERKEYS). /// bool SetFilterKeys(bool enable); /// /// Enables or disables Sticky Keys via SystemParametersInfo(SPI_SETSTICKYKEYS). /// bool SetStickyKeys(bool enable); /// /// Loads a string resource from a native DLL by resource ID. /// Used to resolve localized display names (e.g., theme names from themeui.dll). /// /// Full path to the DLL containing the string resource. /// The resource ID of the string to load. /// The loaded string, or null if the resource could not be found. string? LoadStringResource(string dllPath, int resourceId); }