Investigate the SystemEvents class, which allows your applications to react to several events raised by system activity.
Demonstrates five of the available events of the SystemEvents class. Although there are more events to be tested, this demonstration shows off the events that can easily be tested from a client application.
Requires the Trial or Release version of Visual Studio .NET Professional (or greater).
The Microsoft.Win32.SystemEvents class provides a number of public events that you can sink in your code. In this example, you can test a few of the events (the ones that are easy to trigger via user interface interaction).
To test the events, try these actions:
Check the documentation for the SystemEvents class (and the comments in the sample code) for more information.