Most applications will automatically close or quite when you click the X icon in their main windows. Some programs, like Spotify and ShareX, however will only minimize the app to the icon tray instead of closing. As a result, you have to right click on the app icon from the icon tray, then choose Close or Exit to completely quit the apps other than leaving them running in background. In ShareX, there is option in the Application Settings to force the app to close rather than minimizing to tray. Here is how to achieve that.
Run ShareX on your Windows PC, from its main windows, click Application Settings from the left panel to open it in a new window, then under the General tab, click to turn off the Show tray icon option. At the same time, you may notice the Minimize to tray on start option being grayed out. This is because when there is no tray icon, the app can’t be minimized to tray icon, the app actually closes.