coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for cerunappattime in other DLLs exists, click on Find References to the right.
Public Declare Function CeRunAppAtTime Lib "coredll" _
(ByVal AppName As String, ByRef ExecTime As SYSTEMTIME) As Boolean
User-Defined Types (VB):
Public Structure SYSTEMTIME
Dim wYear As Short
Dim wMonth As Short
Dim wDayOfWeek As Short
Dim wDay As Short
Dim wHour As Short
Dim wMinute As Short
Dim wSecond As Short
Dim wMilliseconds As Short
In VB, function will return "true" if successful when adding app to run. However, it returns a "false" when cancelling the app even though the event is successfully cancelled. I'm guessing this is due to the systemtime structure being passed by reference and in this case references nothing. See sample code below. (VB .NET CF)
Tips & Tricks:
While this wakes the device, the screen may remain powered off. Combine with SetSystemPowerState truly wake up everything.
Also, if the app is making a call to wake itself back up, you can get the full path and appname with system.reflection.assembly. See code below for example.
VB Sample Code:
Dim FullAppName As String = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase
Dim AppPathOnly As String = System.IO.Path.GetDirectoryName(FullAppName)
Dim NewDate As Date
Dim wakeuptime As SYSTEMTIME
Private Sub scheduleapp
NewDate = Now
'take the current time and date and add some hours, minutes, and seconds
NewDate = DateAdd(DateInterval.Hour, 5, NewDate)
NewDate = DateAdd(DateInterval.Minute, 10, NewDate)
NewDate = DateAdd(DateInterval.Second, 30, NewDate)
'populate systemtime structure with our new date
.wDay = NewDate.Day
.wDayOfWeek = NewDate.DayOfWeek
.wHour = NewDate.Hour
.wMilliseconds = NewDate.Millisecond
.wMinute = NewDate.Minute
.wMonth = NewDate.Month
.wSecond = NewDate.Second
.wYear = NewDate.Year
If CeRunAppAtTime(FullAppName, WakeUpTime) Then
MessageBox.Show("App successfully scheduled to run")
MessageBox.Show("Call to CeRunAppAtTime failed")
Private Sub cancelschedule
'Make a call to cancel the scheduled app
Dim cancelapp as boolean = CeRunAppAtTime(FullAppName, Nothing)
This function creates a new user notification or modifies an existing one.
12/22/2009 9:49:22 AM - -220.127.116.11
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).