I'm writing a program in C# .net that changes the desktop background only when the desktop is not visible to the user, i.e. completely covered in some way by the currently open windows.
Ideally the solution would fire an event whenever it detected a change in the desktop's visibility, but right now T'm not even sure how to check visibility in the first place, other than scanning every pixel (incredibly inefficient) or periodically looping through all open windows and checking their dimensions (still inefficient and I've no idea how to implement.)
I've been fooling around with Windows.Forms.Screen and the user32.dll methods listed here, but haven't managed to figure out anything effective.
Many thanks to anyone kind enough to help!
You could just detect when another Windows application is running in full screen mode, which is simplier to detect and more likely than the desktop being covered up by a patchwork of windows.
Example code here: http://www.richard-banks.org/2007/09/how-to-detect-if-another-application-is.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With