trap calendar reminder events

  • Thread starter Thread starter interuser
  • Start date Start date
I

interuser

Hi
on WM5 I want to trap calendar reminders so that I present my own
message and sound.
I tried working with SNAPI and SystemProperty but I cannot figure how
to trap the above event.
Any help would be appreciated.
 
Probably the easiest approach would be to disable the reminder on the
appointment and register your own notification event e.g.
CeSetUserNotificationEx, which will allow you to customize the sound used
and use your own text for title and body of notification bubble.

Peter
 
I would prefer the SNAPI solution if that is possible because it is so
easy developing applications using it.
 
You're looking for an easy way to do it, but its not so easy. SNAPI is
not going to help you here. As Peter put it, using the
Ce*UserNotification APIs are the only way to do what you're asking for.
 
Thanks.
Could someone please send me any (pointers to) instructions on how to
use the Ce*UserNotification APIs in .net 2005?

TIA.
 
Here are codes to find out all notifications

void FindAppointment()
{
//HANDLE hNotifications;
DWORD dwAll = 0;
DWORD dwGet = 0;

CeGetUserNotificationHandles (NULL, 0, &dwAll);
HANDLE *hNotifications = new HANDLE [dwAll];
CeGetUserNotificationHandles(hNotifications, dwAll, &dwGet);
for (DWORD i = 0; i < dwAll; i++)
{
DWORD dwBytesNeeded = 0, dwInsufficient = 0;
CE_NOTIFICATION_INFO_HEADER* pHeader;

CeGetUserNotification(hNotifications, 0, &dwBytesNeeded, NULL);
pHeader = (CE_NOTIFICATION_INFO_HEADER *)malloc(dwBytesNeeded);
if (pHeader != NULL)
{
BOOL result;
result = CeGetUserNotification(hNotifications,
dwBytesNeeded, &dwInsufficient, (LPBYTE)pHeader);
if (result == FALSE)
{
;
}
else
{
ShowNotification(pHeader);
}
}
else
;
SAFE_FREE(pHeader);
}
delete[] hNotifications;
}

ShowNotification is a function that I use to show messages about the
notification.

The other question is:

I am trying to add a notification structure like this

TCHAR szExeName[MAX_PATH], szArgs[128] = TEXT("cmdHitByNotification");

CE_NOTIFICATION_TRIGGER cnt;
memset(&cnt, 0, sizeof(cnt));
cnt.dwSize = sizeof(CE_NOTIFICATION_TRIGGER);
cnt.dwType = CNT_TIME ;
cnt.dwEvent = 0;
//cnt.lpszApplication =
TEXT("\\\\.\\Notifications\\NamedEvents\\ABCDEFG");
cnt.lpszApplication = szExeName;
cnt.lpszArguments = szArgs;
cnt.stStartTime = st; // The time that I defined
cnt.stEndTime = et;
GetModuleFileName(g_hInst, szExeName, sizeof(szExeName));

I found that neither the event "ABCDEFG" is not triggered nor the
execution file szExeName is not executed when the notification is
executed...does anyone have any idea about this??

Alan

interuser æ到:
 
Back
Top