Share via


Implementing the Notification UI (Windows CE 5.0)

Send Feedback

The notification UI communicates notification events to a user and handles these events. The notification UI primarily handles timer events because when the system triggers a system event notification, it creates a time-based notification with the expiration set to the current time.

To implement your notification UI, you can base it on one of the following components:

  • Notifmin, which handles notifications on target devices with no UI. Essentially, this component launches other applications upon event or timer notification when the elements provided by a UI are not available. This component is available in the Gateway and Digital Media Receiver design templates. The source code for this component is in %_WINCEROOT%\Public\Common\Oak\NotifyM.
  • Notifpub, which handles notifications on target devices that are capable of presenting a UI. This component can present a dialog box, flash a light, start a vibrating mechanism, or use any other method of notification that is available on the target device. To enable this functionality, modify this component and insert calls to hardware-dependent device drivers. This component is available in the Smart Phone, Mobile Handheld, Enterprise Web Pad, Internet Appliance, Enterprise Terminal, Windows Thin Client, Media Appliance, and Set-Top Box design templates. The source code for this component is in %_WINCEROOT%\Public\Common\Oak\Notify.

Once you have chosen a suitable component for your notification UI, you must modify this component so that it interfaces properly with the hardware requirements of the target device.

To allow the base notification engine to communicate with your notification UI, your notification UI must expose several functions. The following table shows these functions.

Function Description
CeNotifyPublic_Initialize Initializes the notification subsystem. This function is called once at startup.
CeNotifyPublic_DisposeOfPacket Removes a packet once it has expired, has been handled, or has been removed programmatically.
CeNotifyPublic_NewPacket Creates UI functionality or launches an application for a new packet when a notification becomes active.
CeNotifyPublic_PresentSettingsBox Allows a user to set notification preferences.
CeNotifyPublic_UserAlarmSignalled Signals an auxiliary timer that is set by CeNotifyPrivate_SetUserAlarm. This function is for use with a progressive alarm.
CeNotifyPublic_FilterUserNotification Validates a user notification with existing hardware. For example, notification by vibration is not valid if the target device is not equipped with a vibrating mechanism.
CeNotifyPublic_FilterEvent Validates a system event with existing hardware. For example, power-on notification is not valid if the current power driver does not generate this event.
CeNotifyPublic_UIWndProc Defines a window procedure for a hidden UI window.

If a UI is present, you can register notifications before GWES starts. However, these notifications are not active until GWES is initialized. To call the notification functions, the following events must be complete:

  • Notification subsystem must be loaded by services.exe or devices.exe.
  • Notification subsytem must initialize its storage.

If a notification function is called before the notification subsystem has completed loading, it fails immediately. If it is called after the notification subsystem has loaded, but before the storage is initialized, the function blocks out for a registry-configurable interval defined by HKEY_LOCAL_MACHINE\SYSTEM\GWE\NOTIFY\longapitimeout. The default for this value is 15 seconds.

To allow users to set notification options, the base notification engine can call your notification UI with the CeNotifyPublic_PresentSettingsBox function. Your notification UI should respond to this function call by launching a dialog box that presents a user with all of the notification options that are available on the target device. These options must correspond with the hardware capabilities of the target device.

The base notification engine validates both timer and system events against the hardware that is installed on the target device. For timer events, it uses the CeNotifyPublic_FilterUserNotification function. For system events, it uses the CeNotifyPublic_FilterEvent function. If an application registers for events or event responses that are not available on the target device, these functions should return FALSE.

For an example of how to start a notification UI, see the CeNotifyPublic_NewPacket function in %_WINCEROOT%\Public\Common\Oak\Notify\Notifext.Cxx.

See Also

Implementing Notifications

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.