How can I tell if I'm a service?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



If there is a better newsgroup, please let me know.

I have a Windows GUI (derived from CWinApp) C++ VS 2003 program xyz.exe that
can be started 3 ways:

1) Run at command line
2) Using CreateProcess to start xyz from another foreground process
3) Using CreateProcess to start xyz from a service

Since it is a GUI program, I need to know if it was started from a service
because it then has no user interface. I use that info to suppress calls to
MessageBox, etc.

From my xyz.exe program, how can I tell if xyz.exe was spawned from a
service?

Thanks!
Bruce.


.



Relevant Pages

  • Re: How can I tell if Im a service?
    ... I have a Windows GUI C++ VS 2003 program xyz.exe ... Using CreateProcess to start xyz from another foreground process ...
    (microsoft.public.win32.programmer.kernel)
  • Re: How can I tell if Im a service?
    ... I have a Windows GUI C++ VS 2003 program xyz.exe that ... Using CreateProcess to start xyz from another foreground process ... MessageBox, add the flag: MB_SERVICE_NOTIFICATION, it's ok. ...
    (microsoft.public.win32.programmer.kernel)