12.6. Displaying Dialogs from within a Service

Frequently it is useful to display simple message boxes from within a service. For example, the Messenger service listens on the network for messages sent with the net send command and displays a message box for any messages that arrive. It is easy to modify the beep service shown in Section 12.4 to emulate this behavior. Any more advanced user interface to a service requires that you write a separate GUI front end and hook it to the service with something like a named pipe. Note the use of MB_DEFAULT_DESKTOP_ONLY.

As an example, you might want to create a "logon announcement" service that announces people when they log onto an NT machine on your network. In order to do this, the service will want ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.