How to restore from minimize?

I have a single-window application that uses a dialog window derivative, which has a minimise button.

On the mac, minimise works well when the yellow button is pushed, and the window maximises again when the window’s icon in the toolbar is clicked. So far so good. I notice that other applications will also maximise their minimised windows when the user clicks on the application icon in the dock. How can I get this behavior in my application?

I notice the juce mac demo doesn’t exhibit this behavior either, so perhaps it’s a juce limitation?

Must be some sort of message that I’ve not handled, I guess. Will take a look sometime.