Custom mimimize/restore on Global Floating Window?

Hi all,

Trying to figure out the best approach for this. This is for both Windows and Mac.

My app has a Global Floating Window that sits “always on top” of a third-party application and has tools within the window that interact with that third-party application.

However the window sometimes gets in the way of the third-party app and I’d like to enable the user to click the minimize button in the titlebar of the window and have the window collapse to just be the size of the title bar, which they can then move out-of-the-way atop the third-party app. Clicking the restore button should restore the size and position to where it was at the time of the minimize action.

Is there a way to override the native functionality of the minimize/restore buttons in the title bar?