none
Notification control and LED/Sound/Vibrate RRS feed

  • Question

  • Hello,

     

    In a reminder for a task or appointment the led (light emitting diode, property ReminderLed), sound (ReminderSound property) and vibrate (ReminderVibrate property) can be activated.

     

    I am using a notification control for my .NET CF application. Can I also activate LED/Sound/Vibrate when the notification gets active? Is there an easy way to do this?

     

    Regards,

    Gerben

    Thursday, May 8, 2008 3:24 PM

Answers

  • I gathered some information about Notification on a Pocket PC. Basically, you can setup a notification (play-repeat tune, blink LED, vibrate) by adding a registry key, during installation for example. Then you trigger the notification using the Shell API, or the Notification mecanism provided by OpenNetCF.

     

     

    PocketPC users can customize notifications through the Settings.
    Start / Settings / Sounds & Notifications (Personal Tab) / Notifications Tab
    See screenshot attached.

    The settings are stored in the registry, where it is possible to customize further. This article on MSDN (see Remarks section) describes briefly how to do it.

    Each notification has a key in the registry. They are located under HKCU\ControlPanel\Notifications. The name of the key is a unique class identifier, such as:
    {53DB6D44-7E4A-43eb-B411-67C51CC3B8C9}
    It has five values. All of them optional.

  • (Default) contains the name of the notification, as it appears in the Settings screen. If the name is an empty string, the notification does not appear in the Settings, therefore can not be customized by the user.
  • Wave contains the name of the file to play, with or without path and extension.
  • Duration of LED light flashing, in minutes. 0 means no limit.
  • Options is a bitmask that determines which alerts are on. See below.
  • AvailableOptions is a bitmask that determines which alerts can be modified by the user. See below.

    Alerts

  • Play sound (0x1)
  • Vibrate (0x2)
  • Flash LED (0x4)
  • Display message on screen (0x8)
  • Repeat sound (0x10). Not applicable to AvailableOptions.
  • (0x40000000) allows the user to change repetition. Not applicable to AvailableOptions.

    Sound repetition has two flags in the Options value. It is not controlled by the AvailableOptions value.
    The application running on the device calls SHNotificationAdd to trigger the notification.

    SHNOTIFICATIONDATA sn = {0};
    sn.clsid = TEXT("{53DB6D44-7E4A-43eb-B411-67C51CC3B8C9}");
    [...]
    SHNotificationAdd(&sn);

  • Tuesday, May 13, 2008 2:37 PM

    All replies

    • I believe that the OpenNET CF provides this functionality.

       

      Thursday, May 8, 2008 5:14 PM
    • Hi Gerben,

       

      What is the device you are using? If it is Symbol, it is having its own class library ( https://docs.symbol.com/KanisaPlatform/Publishing/53/11489_f.html), which is containing classes for activating LED, Sound, Vibrator.

       

      Friday, May 9, 2008 9:19 AM
    • Hello Stephen and Selva,

      Thank you for your replies.

      I want to get my application get to work on different windows mobile 5/6 touchscreen devices.

      I have looked for the OpenNETCF led/vibrate library. It looks like there is some trail and error involved to find out how to get a led on/off and the vibration on/off on a specific device. I found out that playing sounds is possibile using Pinvoke.

      Cheers,
      Gerben


      Friday, May 9, 2008 8:40 PM
    • I gathered some information about Notification on a Pocket PC. Basically, you can setup a notification (play-repeat tune, blink LED, vibrate) by adding a registry key, during installation for example. Then you trigger the notification using the Shell API, or the Notification mecanism provided by OpenNetCF.

       

       

      PocketPC users can customize notifications through the Settings.
      Start / Settings / Sounds & Notifications (Personal Tab) / Notifications Tab
      See screenshot attached.

      The settings are stored in the registry, where it is possible to customize further. This article on MSDN (see Remarks section) describes briefly how to do it.

      Each notification has a key in the registry. They are located under HKCU\ControlPanel\Notifications. The name of the key is a unique class identifier, such as:
      {53DB6D44-7E4A-43eb-B411-67C51CC3B8C9}
      It has five values. All of them optional.

    • (Default) contains the name of the notification, as it appears in the Settings screen. If the name is an empty string, the notification does not appear in the Settings, therefore can not be customized by the user.
    • Wave contains the name of the file to play, with or without path and extension.
    • Duration of LED light flashing, in minutes. 0 means no limit.
    • Options is a bitmask that determines which alerts are on. See below.
    • AvailableOptions is a bitmask that determines which alerts can be modified by the user. See below.

      Alerts

    • Play sound (0x1)
    • Vibrate (0x2)
    • Flash LED (0x4)
    • Display message on screen (0x8)
    • Repeat sound (0x10). Not applicable to AvailableOptions.
  • (0x40000000) allows the user to change repetition. Not applicable to AvailableOptions.

    Sound repetition has two flags in the Options value. It is not controlled by the AvailableOptions value.
    The application running on the device calls SHNotificationAdd to trigger the notification.

    SHNOTIFICATIONDATA sn = {0};
    sn.clsid = TEXT("{53DB6D44-7E4A-43eb-B411-67C51CC3B8C9}");
    [...]
    SHNotificationAdd(&sn);

  • Tuesday, May 13, 2008 2:37 PM
  • Hello Yalb,

    Thank you for your answer. This really helps and is what I was looking for!

    I'm going to try to implement it this week.

    Best regards,
    Gerben
    Tuesday, May 13, 2008 6:47 PM