I am developing a desktop application that will run on user's PC in background(system tray). User won't have to start the app as it starts with the system. Basically this app listens to a port and waiting for http request. Users will be able to change the port(rare case) by clicking the application's system tray icon. Here is the screenshot:
I don't want the users to close the app accidentally. Should I use the close button as minimize to system tray or the minimize button itself?
Edit: Users can quit the app by system tray icon's menu. Like: Skype.
n.b. I disabled the maximize button as the window size is fixed.
I uses to dislike applications that "unexpectedly" continued to run after you clicked "close", but in this instance, I don't think this is the case and that adding a "Minimise to tray" icon would be the wrong approach. My reasoning:
From the description, your "real application" is a service (or an auto-starting process) that sits in the background doing it's job (listening for incoming requests).
While running, it displays an icon in the system tray that (a) shows the user it is running, (b) allows them to stop it, and (c) allows them to change the configuration.
The GUI you've shown isn't your real application. It's simply a screen where you can configure it's operation. As such, closing that window (using the normal "X" icon) should not affect the main [background] application.
However, because users may not be fully aware that the screen shown is simply a configuration tool, the first time they click the "X" icon, you may want to show a message informing them that the application will continue to run in the background.
Because of the above, you may want to remove/disable the minimise icon (as you've done for the maximise icon), although there's probably no harm in leaving it doing what it currently does (using this button wouldn't give the above warning).
Finally, if you feel "stopping the [background] application" is going to be a sufficiently common task, you may want to add a normal, in-window button to the configuration screen (e.g. "Terminate XYZZY Listener") as well as the option that's on the system-tray icon.
Remove the minimize and maximize buttons so there is only the close button. And then use the window as a form of dialog window because its only used for such a simple task. Maybe add a close button at the bottom.