views:

43

answers:

1

Windows Mobile can show different kind of user notifications, like this:

alt text

How can I enumerate through the reminders, windows mobile is showing to the user?

+2  A: 

By P/Invoking CeGetUserNotificationHandles followed up by a call to CeGetUserNotification.

The SDF already has it wrapped with Notify.GetUserNotificationHandles follwed by a call to GetUserNotification with each of those handles.

ctacke
Sorry, forget my previous comments - how do I identify the notifications which are active on the display?
Sam
@Sam: you would call CeGetUserNotificationHandles twice. Once with 'null' and zero as the first two parameters. After that you use the returned trueCount value to initialize your handles array and then call the function again as you did before. That should now give you an array of handles you can use with CeGetUserNotification.
tomlog
Yep, took me a moment to realize how these are used. But now I need to identify which of the 269 notifications are the ones being shown actively to the user - you got any idea about this?
Sam
@Sam: well, you can't tell from their handles, so you would need to loop through the list and look at each notification's header (which you can get from calling CeGetUserNotification with the correct buffer size) to see what the status is (have a look for CE_NOTIFICATION_INFO_HEADER on MSDN).
tomlog
I just checked them. For example, if I got two notifications, one missed call and one unread sms, I'll have only one active item in the notification list. I wonder how to find these items meaning.
Sam