If you have access to the source code of the Winform application you could establish an IPC mechanism, your service and your GUI application communicate usingthis mechanism. You can than tell the winform application that the application has to be terminated.
That is a clean and safe way.
In the windows SDK you will find an example under "Samples\winbase\service". This example contains a small windows service and a client application. both are communicating using pipes.
Označen jako odpověďJupiterLee25. července 2012 12:59