Allow Desktop App to "close" to Windows SysTray

When I click “X” in the top right corner of the Desktop App, the app closes… Add an option to minimize to systemtray when minimized or “X” is clicked. i.e. Microsoft Teams has a setting, “On close, keep the application running” which, when checked, sends Teams to the systray.