这对于 95% 的使用情况来说非常有用,但有时我又需要一个小鼠标指针来进行更精细的工作。
不幸的是我每次都必须打开设置,我想要一个键盘快捷键,可以用来在大鼠标和小鼠标之间切换。
所以我写了以下内容,希望能起到作用:
SystemParametersInfo()参数调用SPI_SETCURSORS来点动系统以重新读取鼠标设置。唉,没有喜悦。
谁能指出我的做法是愚蠢的吗?干杯,戴夫
代码如下:
param([int]$MouseSize=0)
###########################################
#
# DISAPPOINTINGLY THIS DOES NOT YET WORK
# Need to figure out why
#
###########################################
##################
# Constants
##################
[int]$small_mouse = 48
[int]$big_mouse = 80
[int]$min_mouse = 1
[int]$max_mouse = 256
[string]$path = 'HKCU:\Control Panel\Cursors'
[string]$name = 'CursorBaseSize'
##################
# API Import
##################
Try{
[void][SysParams]
} Catch {
Add-Type @'
using System;
using System.Runtime.InteropServices;
public class SysParams {
[DllImport("user32.dll", SetLastError …Run Code Online (Sandbox Code Playgroud)