4

How can we get notified by Windows when the user has changed their Desktop Background/Wallpaper? I'm looking for some kind of event, and I'd rather not use a Timer and keep checking all the time.

uSeRnAmEhAhAhAhAhA
  • 2,527
  • 6
  • 39
  • 64
  • 2
    Use the SystemEvents.UserPreferenceChanged event instead of the timer. – Hans Passant Oct 03 '13 at 21:41
  • possible duplicate of [How can I detect wallpaper changing as a result of the Windows 7 slideshow?](http://stackoverflow.com/questions/5537836/how-can-i-detect-wallpaper-changing-as-a-result-of-the-windows-7-slideshow) – David Oct 03 '13 at 21:42
  • @David, I did see that question but dismissed it as I thought it was only for wallpapers part of slideshows. But thanks, I'll look at it again. – uSeRnAmEhAhAhAhAhA Oct 03 '13 at 22:30

1 Answers1

5

Add a message handler for WM_SETTINGCHANGE, SystemEvents.UserPreferenceChanged in .NET

In all operating systems since at least Windows 95 a WM_SETTINGCHANGE was sent when the desktop wallpaper has been changed by the user or a slideshow.

Source Thread

Community
  • 1
  • 1
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331