0

I need to know how to hide Windows Desktop and change desktop background color in c# and restore the previous configuration.

Any idea?

BR

Santiago
  • 2,190
  • 10
  • 30
  • 59

2 Answers2

2

Enumerate all desktop window with EnumWindows. Collect every visible window handle.

Call ShowWindow with appropriate arguments to make the collected windows to be visible/invisible.

Take note that all created windows after this operation will be visible. To hide desktop icons you shall spy the window structure (with a tool like Spy++), get specific window handle by its class name and then call ShowWindow on the obtained widnow handle.

Of course, EnumWindows and ShowWindow must be P/Invoked. See www.pinvoke.net for getting the correct declaration.

Luca
  • 11,646
  • 11
  • 70
  • 125
0

This shows you how to change the desktop wallpaper: http://www.c-sharpcorner.com/UploadFile/DipalChoksi/ChangeWallpaper11092005051646AM/ChangeWallpaper.aspx.

Icono123
  • 3,830
  • 3
  • 21
  • 20