title: Catch when minimize button was pressed on any window
body: <p>So I'm trying to make window manager that could minimize windows into something like Facebook Messenger chatheads. For that i need to catch minimize event on any window that is open when my program starts, or will be opened later. And that's the tricky part, at least for me. The only way I could think of was global hooks, but as far as I know, they are only applied to windows that are currently opened and not the ones that will open later, which means i would have to actively look for any new windows and hook into their wndproc too which would be performace heavy. Also as I was reading about hooks, I found that it's discouraged to use them as they rather heavily impact performance.
  So my question is what is the best way to catch minimize events?</p>
  
  <p>Thanks in advance,
  Ignas</p>