May be...
How to Know If the Exe is Running as a Service
The easiest way to know if your app is running as a service is to test System{'ss:AmService'}. This is set to true when the program is in service mode. For example;
If System{'ss:AmService'} = true
! in service mode
End
This approach only works if you are using Clarion 10.11975 or later.
The advantage of this approach is that the code is system-global, meaning it'll work in pre-compiled DLL's, classes with no access to global data and so on.
If you are using an older build of Clarion then we recommend either (a) upgrading, or following one of the steps described in Destroy Controls above.