CeSetUserNotificationEx (coredll)
Last changed: Dr. Spack-212.4.67.34

.
Summary
This function creates a new user notification or modifies an existing one.

C# Signature:

[DllImport("coredll.dll", EntryPoint="CeSetUserNotificationEx", SetLastError=true)]  
private static extern int CeSetUserNotificationEx(int hNotification, byte[] lpTrigger, byte[] lpUserNotification);

[DllImport( "coredll.dll" )]
private static extern IntPtr CeSetUserNotificationEx( IntPtr notification, CE_NOTIFICATION_TRIGGER notificationTrigger, CE_USER_NOTIFICATION userNotification );

VB Signature:

Declare Function CeSetUserNotificationEx Lib "coredll.dll" (TODO) As TODO

User-Defined Types:

CE_NOTIFICATION_TRIGGER

CE_USER_NOTIFICATION

SYSTEMTIME

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Taken from openNetCF in OpenNETCF.Win32.Notify

Tips & Tricks:

Please add some!

Sample Code:

Start an Application in 5 minutes. (Even when the device is suspending)

  string appName = "\\Application.exe";
  string args= "";
  System.DateTime dt = System.DateTime.Now.AddMinutes( 5 );

  CE_NOTIFICATION_TRIGGER notificationTrigger = new CE_NOTIFICATION_TRIGGER();

  notificationTrigger.Type = 2;
  notificationTrigger.AppName = appName;
  notificationTrigger.Args = args;
  notificationTrigger.StartTime = new SYSTEMTIME( dt );
  notificationTrigger.EndTime = new SYSTEMTIME();
  notificationTrigger.Size = (UInt32)Marshal.SizeOf( notificationTrigger ); // This line needs the compile switch /unsafe

  IntPtr notificationHandle = CeSetUserNotificationEx( IntPtr.Zero, notificationTrigger, null );

Documentation