Hello everyone,

My application can be started as both console mode from main function and servide mode from OnStart.

My question is, is there any elegant way to detect whether the application is run under console mode or servide mode? Currently, I set a status in main function manually to detect whether it is run under console mode or service mode.

Any more elegent solution or built-in API I could use?

thanks in advance,