In the window title bar of my app, there is a minimize, maximize and close buttons. I saw another app (leechftp, getright) and it had a "minimize to tray" button, also in the window titlebar.

Does anyone know how to add that button to the title bar and how to know if it was clicked?

Gerco.