How to detect Visual Studio 2012 theme changed using IVsBroadcastMessageEvents

In this post I showed an approach using an invisible form to trap the WM_SYSCOLORCHANGE message that is fired when VS 2012 changes the current theme (from Dark to Light or viceversa). Don’t miss the comment in that post  where Sean points how to do it for packages using the IVsShell and IVsBroadcastMessageEvents interfaces. You can use that approach in an add-in too since you can get services as I explained in the article:

HOWTO: Get a Visual Studio service from an add-in

I have tested it today and it works like a charm.