I have an app that I can has been set up as an NT service. Before I had done so, it had been set up as a standalone exe that would run in the background and execute a routine every 10 secs or so. The app would run continuously until a flag file was "seen" by the app, which will trigger the app to exit.
However, when run as a service, although the app stops fine, I am concerned about the srvany process remaining in memory. Is there an API call that could be issued to that would allow me to gracefully exit the app before terminating the service.
In other words if the command,"net stop servicename", were issued, I would like it the app to finish processing what it is currently doing, check for the stop request, exit the app & vfp then terminate.
Any ideas?
Thanks