I have a class that accesses the win32 API to pull the location, size, state, and edge of the taskbar. I use the class to know where to create alerts depending on where the taskbar is. I have a method that updates the alerts location depending on when the taskbar is when a new alert is generated or deleted.
Is there a way to detect when the taskbar moves so I can call the update method? That way if a user moves the taskbar the alerts move to the appropriate location instead of being in a ridiculous location until a new alert comes or one is deleted.
My thought was to have a timer checking against the current taskbar object i generated last with a new one every second or so and calling the update method if something changes. I'm just wondering if there is an "easier" or "better" way to do this.
(Using Visual Studio 2010 C#)
TL;DR Need to detect when the taskbar moves to call a method.