Use the static events in the SystemEvents class found in the Microsoft.Win32 namespace. There are many events in this class. Here are a couple: