(OS X) Detecting when front app goes into fullscreen mode

I'm writing a "UIElement" app that shows a status window on the side of the screen, similar to the Dock. Now, when a program takes over the entire screen, I need to hide my status window, just lik...