>I have a VFP8 program starting as a Windows Service and running under the Local System user. I used the MS utilities INSTSRV.EXE and SRVANY.EXE to create the registry entries for the service, and the program does successfully Start and Stop.
>
>The problem is that the program opens up a file, and when the service is Stopped (manually through Services), there is a .tmp file being left in the Windows\Temp folder because the file in the program is not being properly closed when the Stop is issued.
>
>Is there a way for a program to detect that the service that started it has stopped? I use "On Shutdown" to detect a reboot, and that works fine, but it sure doesn't detect the service stopping.
>
>Thanks,
>Curt
Would this work for you
http://www.berezniker.com/display/VFP/Windows+Service+Status ?
If it's not broken, fix it until it is.
My Blog