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:
SystemEvents.DisplaySettingsChanged += new System.EventHandler(displaySettingsChanged);
SystemEvents.UserPreferenceChanged +=
new UserPreferenceChangedEventHandler(userPreferencesChanged);
.............
.............
private void displaySettingsChanged(object sender, EventArgs e)
{
MessageBox.Show(e.ToString());
}
private void userPreferencesChanged(object sender, UserPreferenceChangedEventArgs e)
{
switch(e.Category)
{
case UserPreferenceCategory.Locale:
MessageBox.Show('Changed locale');
break;
default:
MessageBox.Show(e.Category.ToString());
break;
}
}
Share with