How to find out the solid color used for the Windows Wallpaper?

Alexandru Pupsa picture Alexandru Pupsa · Jul 23, 2012 · Viewed 17.4k times · Source

I know how to retrieve the wallpaper from the registry:

HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper

But what if the user chooses to use a solid color as a wallpaper, how do I retrieve that specific color?

Answer

Appleman1234 picture Appleman1234 · Jul 23, 2012

You can retrieve it from

HKEY_CURRENT_USER\Control Panel\Colors\Background

It is a string containing a space-seperated tuple "R G B", e.g. "255 0 0" for red, "255 102 0" for orange.

See here for information on acquiring the registry value using C#, C++, F#, and VB.NET.

And the example below for Powershell

# PowerShell Registry Key example
$Registry_Key = "HCU:\Control Panel\Colors\"
Get-ItemProperty -path $Registry_Key -name Background