Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than coredll, prefix the name with the module name and a period.
CeRunAppAtTime (coredll)
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
End Structure
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
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 remains powered off. Combine with SetSystemPowerState truly wake up everything.
VB Sample Code:
Dim app As String = "\path\testapp.exe"
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
With wakeuptime
.wDay = NewDate.Day
.wDayOfWeek = NewDate.DayOfWeek
.wHour = NewDate.Hour
.wMilliseconds = NewDate.Millisecond
.wMinute = NewDate.Minute
.wMonth = NewDate.Month
.wSecond = NewDate.Second
.wYear = NewDate.Year
End With
If CeRunAppAtTime(app, WakeUpTime) Then
MessageBox.Show("App successfully scheduled to run")
Else
MessageBox.Show("Call to CeRunAppAtTime failed")
End If
End Sub
Private Sub cancelschedule
CeRunAppAtTime(app, Nothing)
End Sub
Controls the overall device power state
9/22/2008 7:46:50 AM - -80.138.195.32
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).