is there an easy way to hook to an event that is triggered on change of global screen resolution?
3 Answers
Handle the following event:
Microsoft.Win32.SystemEvents.DisplaySettingsChanged
You may refer to this page for more details.
You may also wanna see the msdn article on SystemEvents class.

- 35,511
- 22
- 84
- 118
Sure you don't have to unsubscribe to static events (or any events) if your program (process) is dying. The OS will take care of releasing all memory of your process to the OS. However, if you subscribe to a static event or to any event pointing to an object with a longer lifetime than your object subscribing, and you want that object to be eligible for GC - you need to unsubscribe (-=) to the event.
AND it is always good practice to always unsubscribe to all events. You never know when the lifetime of your objects are changed (by someone else) during the lifespan of your source code / product...

- 41
- 1
try this simple code
using Microsoft.Win32;
SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged);
static void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e)
{
MessageBox.Show("Resolution Change.");
}
and don't forget this line using Microsoft.Win32;

- 2,330
- 2
- 19
- 40