tisdag 13 oktober 2009

ClearUserNotification

Yesterday you learnt how to create a notification using SetUserNotificationEx and today you will learn how to remove the notification you just created. The API to use is CeClearUserNotification and to use it you pass a handle to a existing notification.

Here is the declaration of CeClearUserNotification.

        [DllImport("CoreDLL.dll", SetLastError = false, EntryPoint="CeClearUserNotification")]
public static extern bool ClearUserNotification(IntPtr hNotification);


And using it you do a little something like this.

IntPtr hNotification;
/*
Call CeSetUserNotificationEx and save its output in hNotification
*/

if ( ClearUserNotification(hNotification) )
MessageBox.Show("Successfully cleared the notification");
else
MessageBox.Show("Failed to clear the notification");

Inga kommentarer:

Skicka en kommentar