Service Programming - How to tell if the current process is running as a Windows Service..
-
I'm writing a .DLL that's being used in both our Client and Server application. Is there a windows call I can use that will tell me if the current process is running as a windows service or not? Thnx. M.
-
I'm writing a .DLL that's being used in both our Client and Server application. Is there a windows call I can use that will tell me if the current process is running as a windows service or not? Thnx. M.
Can't you use GetCurrentUser? I'm pretty sure that a service will default to LocalSystem, or such. I'm also pretty sure that it can do clever things like ImpersonateUser, etc, but you can't cover everything! Lastly, doesn't a service run from a different context, so GetDesktopWindow would fail? While not a black and white answer for you, I hope that helped. Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
-
I'm writing a .DLL that's being used in both our Client and Server application. Is there a windows call I can use that will tell me if the current process is running as a windows service or not? Thnx. M.
-
I'm writing a .DLL that's being used in both our Client and Server application. Is there a windows call I can use that will tell me if the current process is running as a windows service or not? Thnx. M.
Mike Doner wrote:
Is there a windows call I can use that will tell me if the current process is running as a windows service
You can check whether one of the parent processes of this process is
services.exe
, user services are created via this process.Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com