문제

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

Any idea?

BR

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top