Does anyone know how to progmatically set the desktop background color?
(C# 2003)
(C# 2003)
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Here an example, I hope this help you:
using System.Runtime.InteropServices;
...
const int COLOR_DESKTOP = 1;
uint RGB(byte byRed, byte byGreen, byte byBlue) {
uint res = byBlue;
res = res<<8;
res+=byGreen;
res = res<<8;
res+=byRed;
return res;
}
...
[DllImport("user32.dll")]
public static extern bool SetSysColors(int cElements, int[] lpaElements, uint[] lpaRgbValues);
...
int[] aiElements = {COLOR_DESKTOP};
uint[] aColors = {RGB(0x00, 0x80, 0x00)};
SetSysColors(1, aiElements, aColors);