The information in this article applies to:
SUMMARYWhen developing a Windows NT service, it may be desirable for the service to create a notification icon in the taskbar's notification area to notify the logged on user of the state of the service. MORE INFORMATION
Notification icons are added, modified and deleted using the Shell_NotifyIcon API. Since Shell_NotifyIcon relies on windows messaging to communicate with the taskbar, there are some limitations on calling Shell_NotifyIcon from a service. Q173687 HOWTO: Access the Application Desktop from a ServiceOnce the service has access to the interactive desktop, the service must know when to call Shell_NotifyIcon to create the notification icon. Assuming that the taskbar has already been created, the service can call Shell_NotifyIcon when the service starts. A problem occurs if the taskbar has not been created, for example when there is no user logged on interactively. In this case, Shell_NotifyIcon fails to create a notification icon. The service would then need to be notified when the taskbar is created so it can successfully call Shell_NotifyIcon. A notification is sent in the form of a registered window message, "TaskbarCreated", that is broadcast to all top-level windows when the taskbar is created. The service can then create the notification icon when handling this message. An alterative approach to creating the notification icon from a service would be to create a second application that is started when a user logs on the system. This application would create the notification icon and communicate with the service through some IPC mechanism or with the Service Control Manager to determine the state of the service. Windows NT 4.0 only: The "TaskbarCreated" message is only sent on shell version 4.70 and later. Earlier versions of the shell do not send this notification. Shell versions prior to 4.70 can be updated by installing Internet Explorer 4.x with the Desktop Update. REFERENCESFor additional information, please see the following article(s) in the
Microsoft Knowledge Base: Q173687 HOWTO: Access the Application Desktop from a Service Additional query words:
Keywords : kbLib kbNTOS400 kbWinOS2000 kbSDKPlatform kbSDKWin32 kbShellGrp kbGrpUser kbDSupport |
Last Reviewed: December 7, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |