我编写了下面的代码来影响(我认为)是 Windows 10 中唯一负责光标和指针大小的 reg 键。
这是我到目前为止的代码(其中有一些额外的评论):
$RegConnect = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]"CurrentUser", "$env:COMPUTERNAME")
$RegCursorsAccess = $RegConnect.OpenSubKey("Software\Microsoft\Accessibility", $true)
$RegCursorsControlPanel = $RegConnect.OpenSubKey("Control Panel\Cursors", $true)
# In the code below I'm trying to change the size of the cursor.
$RegCursorsControlPanel.SetValue("CursorBaseSize", 48)
$RegCursorsAccess.SetValue("CursorSize", 3)
$RegCursorsAccess.Close()
$RegConnect.Close()
# This section is where I thought it would update the cursor size.
# Here is where it lists stuff relating to setting and updating any settings changed.
# https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa
# SPI_SETCURSORS
# 0x0057
# Reloads the system cursors. Set the uiParam parameter to zero and the pvParam parameter to NULL.
$CSharpSig = @'
[DllImport("user32.dll", EntryPoint = "SystemParametersInfo")]
public static extern bool SystemParametersInfo(
uint uiAction,
uint uiParam,
uint pvParam,
uint fWinIni);
'@
$CursorRefresh = Add-Type -MemberDefinition $CSharpSig -Name WinAPICall -Namespace SystemParamInfo -PassThru
$CursorRefresh::SystemParametersInfo(0x0057,0,$null,0)
Run Code Online (Sandbox Code Playgroud)
它将更改注册表中的正确值。
因此,如果我运行此 PowerShell 代码,则“轻松访问”设置中的鼠标大小处于正确值。
但是光标不会更新。
如何在不注销并重新登录或重新启动机器的情况下强制更新。
以下是一些相关的 MS 链接:
如果我从 Sysinternals运行Process Monitor并深入挖掘,我可以在堆栈摘要下看到这一点。
这可能会让比我更有见识的人找到如何更新鼠标大小。
该HKCU\Control Panel\Cursors\(Default)部分SettingsHandlers_nt.dll
这也适用于可访问性部分。 Windows.UI.Accessibility.dll
以下是我在 Process Monitors 过滤器中用于缩小项目范围的设置。
小智 8
因此,在使用作弊引擎对 SystemSettings.exe 进行了一些修改之后,我发现了 MS 如何设置光标大小。它最终仍然使用 SystemParametersInfo 但带有一些未记录的参数。尝试以下方法:)
SystemParametersInfo(0x2029, 0, 16, 0x01);
Run Code Online (Sandbox Code Playgroud)
将光标大小设置为 16。是的,您可以低于最小值 32,一直到 1 :)
| 归档时间: |
|
| 查看次数: |
2238 次 |
| 最近记录: |