grip003 Posted October 18, 2006 Posted October 18, 2006 Is there any way to create a windows service and have that service load up a form and then minimize it to the system tray? I have a backup utility application that I wrote to backup a server, and one day the server went down while I was on vacation. I had them boot it back up, but the backup utility would not start unless a user logged into the server, which I did not allow while I was away. I would really like that backup utility to run as a service so I could avoid this problem the next time the server needs to be re-booted. So far, I have tried to create a service that loads my main form in the OnStart() function. The service starts, but no form is loaded. Any ideas? Quote
mooman_fl Posted October 18, 2006 Posted October 18, 2006 This may be a silly question, but did you try putting a link to your backup utility program in the Start folder? Or making a registry entry in one of the Run folders? Edit: NM I thought about it and answered my own question. Start and run work when you log in. Never tried making a service so unfortunately I won't be much of a help. Quote "Programmers are tools for converting caffeine into code." Madcow Inventions -- Software for the Sanity Challenged.
Administrators PlausiblyDamp Posted October 18, 2006 Administrators Posted October 18, 2006 Services run under their own desktop - any forms they display will be displayed on this desktop and not visible to any other logged in user. You would need to create a separate application that runs under the user's profile and communicates with the service. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
grip003 Posted October 18, 2006 Author Posted October 18, 2006 If I were to have a completely separate application that does all the work, could I use the service to start that application? If I did this, would the application just run in that 'other' desktop? Quote
Administrators PlausiblyDamp Posted October 18, 2006 Administrators Posted October 18, 2006 The service would be set to auto-start and would therefore be automatically started when the server was rebooted. The UI would be a separate application that would be launched either on demand by a user or as part of their start-up group (or similar). Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
grip003 Posted October 19, 2006 Author Posted October 19, 2006 I'm sorry, I still think I don't understand. The real question I think I have is can the GUI application BE the service? I use the GUI to display progress bars and I use it to set up backup scheduling. The software can also auto-burn backups as well, so the scheduling for that is also done through the GUI. Maybe this application is just not service material? Quote
Administrators PlausiblyDamp Posted October 19, 2006 Administrators Posted October 19, 2006 No - a service cannot display any UI stuff as it has it's own desktop and this is where the UI would appear rather than the desktop of a logged on user (if there even is a logged on user). Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.