如何找出用于 Windows 壁纸的纯色?

Ale*_*psa 3 windows registry wallpaper

我知道如何从注册表中检索壁纸:

HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper
Run Code Online (Sandbox Code Playgroud)

但是如果用户选择使用纯色作为墙纸,我该如何检索该特定颜色呢?

App*_*234 5

你可以从

HKEY_CURRENT_USER\Control Panel\Colors\Background
Run Code Online (Sandbox Code Playgroud)

它是一个包含空格分隔的元组“RGB”的字符串,例如“255 0 0”代表红色,“255 102 0”代表橙色。

有关使用 C#、C++、F# 和 VB.NET 获取注册表值的信息,请参见此处

以及下面的 Powershell 示例

# PowerShell Registry Key example
$Registry_Key = "HCU:\Control Panel\Colors\"
Get-ItemProperty -path $Registry_Key -name Background
Run Code Online (Sandbox Code Playgroud)