CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2001
    Location
    Bangalore, India
    Posts
    29

    An application which is a service can have a GUI (a dialog box - SDK) or not?

    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

  2. #2
    Join Date
    Aug 2002
    Location
    Redmond, WA, USA
    Posts
    88
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured