How do you test if a service is already running?

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

Can you tell me how to test if a service is already running?

I would like to do this so I don't have to re-start the service every time I start the app that starts the service.

Thanks.
 

mmieher

Active Member
Licensed User
Longtime User
IsPaused Function

Maybe I am not using IsPaused correctly, but it seems that the code below ALWAYS says the TechLoc service is already running -- even after using task killers to insure it is not there. Am I doing something wrong? Thanks.

Sub Activity_Create(FirstTime As Boolean)

If IsPaused(TechLoc) = True Then
ToastMessageShow("Service Already Running",False)
Activity.Finish
Return True
End If

StartService(TechLoc)
Activity.Finish

End Sub
 
Upvote 0
Top