Windows Develop Bookmark and Share   
 index > Windows Forms General > open an application from a windows service
 

open an application from a windows service

Does anyone know how to open an application from a windows service??

I have an application that I have to run while passing command line parameters.  I figured I could open up this application from a windows service while passing the parameters along with the application call.  Does this sound possible??  Any help I could get would be greatly appreciated.

Rick
MigrationUser 1  Wednesday, January 07, 2004 10:33 AM
I'm not sure what you want to do. Do you mean you want to start a WinForms application--with the user interface--from the service? Or just run an app? Either should be just like calling any app from another. 

Please tell us more about what you want to do.

Don
MigrationUser 1  Thursday, January 08, 2004 2:18 PM
Don,

Thanks for the reply.   I just figured it out.    I was simply running a windows service that was calling a windows application with no interface that would run processes daily at particuliar times.  I was running into an error when I was trying to pop a message box in the windows app just to see if the call worked.   I changed the message box to a log file and that appeared to correct the issue.  Thanks again for inquiring about the issue.

Rick 
MigrationUser 1  Thursday, January 08, 2004 2:45 PM
Hi

I'm a very newbie and i'm attempting to launch an app a from or within a service (message box would do).

I've used the MS SDK for Java to create my service, with the jntsvc tool, which can output text to the event log but when i try to call a form method defined in another .class file the process just hangs before timing out.
My service has processes defined for the start, stop, pause and restart events; no matter which of these i use the same thing happens.

I created the form.class file using Visual J++ RAD.  The file has a main process and works fine if i call it from any other program i create.

Any help would be greatly appriciated.

Thanks

Dylan

p.s. Also if anyone can point me to some tutorial sites for beginners (J++, SDK, services).
MigrationUser 1  Tuesday, February 17, 2004 11:29 AM
By default, a service cannot interact with the desktop, and if you call a method that does, it might just hang.

One way to fix that is to allow the service to interact with the desktop - there's an option in each service's control panel.

However, I'd recommend against this - the whole point of a service is to be in the background and not require human input. So it's rare that it should be interacting with the desktop (and I think it might pose a security risk, too).

If the service must get something to the desktop, I believe the "right" way to do is is to have an application that talks to this service. Similar to what most virus scanners do - they'll have a systray app that can talk with the service and do its bidding.
MigrationUser 1  Friday, February 20, 2004 7:37 PM

You can use google to search for other answers

Custom Search

More Threads

• error messages.
• .NET 2.0 Winform Printing Issue
• DateTime picker inside the dataGridView
• Combo box in DataGrid in WinForms VB.net 2003
• How do I get a progress bar to display the progress of an operation ?
• Multiple DropDownList changes At a time when one dropdown chaged
• validate xml file
• Easy Question - I feel retarted asking this...
• Regarding Wrapper clasess
• WebBrowser and retrieving script errors