Reputation: 2330
I need to know how to hide Windows Desktop and change desktop background color in c# and restore the previous configuration.
Any idea?
BR
Upvotes: 0
Views: 1711
Reputation: 11991
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.
Upvotes: 2
Reputation: 3950
This shows you how to change the desktop wallpaper: http://www.c-sharpcorner.com/UploadFile/DipalChoksi/ChangeWallpaper11092005051646AM/ChangeWallpaper.aspx.
Upvotes: 0