How to make unclosed application in C#? I want to disable the \'X\' button of the form and prevent the Windows Task Manager from closing it as well.
I know that one
This isn't an answer to the question, but I think it might be important to point out that it is not always invalid to create an application that the user has to really go to great lengths to terminate. In the case of an internal private application which is designed to run on machines owned by a company and operated by employees of the company who use the app to do their work as employees, it would be perfectly legitimate to force the app to always stay running. @TvmMurthy question appears to be dealing with exactly this situation.
In my own work, MS Outlook is started up as one of my workstation's startup apps, and I leave it running all day, and into multiple days until I reboot the machine. I have also written Windows Form apps that keep me informed about the status of processes I am responsible to monitor on some of our servers. I wrote these apps to specifically stay running all the time, and only manifest themselves as popups when something is detected that I need to know about (they minimize to the toolbar to keep them out of the way). I use SharpReader for keeping up with my RSS feeds, and it is naturally designed to run constantly. It minimizes to the toolbar, even if you click the red X, and can only be terminated by a context menu from the toolbar or by use of the Task Manager -- and this is perfectly reasonable, even expected, given its function!
Devs should not make the assumption that all applications are voluntarily installed and used by users who are free to run whatever software they desire and when they desire to use it, or that their own preferences are what govern the industry or other users. It is Business Requirements that govern application behavior, not prejudices of developers. As a developer working in industry, I've been required to write lots of behaviors into software that I wouldn't have written had I been writing the software for myself.
Downvoting a question because you don't like what the user has been clearly directed to design into his or her application displays a kind of pettiness or closemindedness that is not particularly commendable. Upvoted question to counteract this.