Good day!
Mayby somebody of You has any idea how to process extern application`s window maximization. I write a sidebar, and when some window is maximized, it shoud be resized to fit free work area.
Set a hook. Look to MSDN for the docs for SetWindowsHookEx(). There are plenty of examples of such hooks at http://www.codeproject.com.