My problem is that I want to create a background application but with a user interface that could be restored and minimized to the system tray and it starts with windows. I trie
Creating a form and hiding it is the way to go if you want your application to start when the user logs in.
If you want your code to run even if no user is logged-in, then you will require a windows service.
If you choose to go down that road, you most likely will want to have an application that, somehow, interacts with your service.