Click to See Complete Forum and Search --> : An application which is a service can have a GUI (a dialog box - SDK) or not?


mailtokannan
October 11th, 2002, 12:36 PM
Hi all,

I am trying to create an application using C++ - SDK which should run as a service in Windows 2000.

I also need to have a Dialog box and few buttons in that which has user interactions.

This service should also be present in the system tray...

Does anyone know how to do that? or someone has code snippet to do this?

Your earliest reply would be of great help.

Thanks and Regards
Kannan S

RobAnd
October 11th, 2002, 03:59 PM
Do not do this. It is VERY bad practice to display a UI from the context of a service because the majority of services run in the security context of LocalSystem. The LocalSystem security context has complete and free reign of the system and can do everything that the Administrator can do and more. If a service running as LocalSystem displays a UI, it is possible for anyone on the system to run any arbitrary code they want with a little effort. This arbitrary code could potentially elevate privileges or do any other malicious act.

The recommended way of acheiving what you are trying to do is to have an application (client) that runs at logon time of every user. That client would then *talk* to the service using some IPC mechanism such as pipes, sockets, events, etc.

Just my $0.02

- Robert