Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Gentleman's!


Actually, I have created Windows Form application, which i have to start that application in background its just runs like Task scheduler (Don't tell that "Put your application on startup") hehe... / how do i add windows form application in Window service. that will show a Window form application. Usually, Windows service file doesn't have UI. but i want to add Windows Form App to Windows Service...


Is it Possible??

C#
Posted
Comments
Sinisa Hajnal 28-Oct-15 3:43am    
You could try starting separate process from windows service Process.Start (yourAppFileInfo)...but...WHY? do you need such a thing? If user starts the app. Why not create console app that does what is needed and call it from the windows default scheduler (no service needed)...that console can then start UI if needed.

Additional benefit is that you can setup your parameters to tweak the behavior of the console app.
Santosh Kokatnur 28-Oct-15 3:53am    
Actually, My Win FORM application having UI. Its a scheduler application which i user want to set his time and particular day.
[no name] 28-Oct-15 3:45am    
You want to open the Windows form application(UI) on interval basis using Windows Service?
[no name] 28-Oct-15 5:29am    
You can use windows scheduler to run an application:

http://www.c-sharpcorner.com/UploadFile/manas1/console-application-using-windows-scheduler/
Santosh Kokatnur 28-Oct-15 5:47am    
Without use of Task scheduler I have to run an app in background!

1 solution

There is no way to add UI to Windows Service. I participated in projects where we implemented dozens of Windows Services and UI that presents their status. Always these are two different applications that communicate with each other using different protocols. We communicated using sockets, files, etc. Right now the most convenient and efficient way to do this communication is WCF. You define API and communicate using them, once you establish whole infrastructure you'll have feelings that you work with one application.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900