I have a Winforms application, which I'm able to minimize by clicking on the corresponding button on the top right of the window; I can then maximize it by clicking on this application's taskbar icon.
My problem is that if the window is maximized, it should be minimized when I click on the taskbar icon again, and it's currently not happening.
How can I make this behavior happen? I don't want to have to use NotifyIcon or system tray.