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.
SetSystemTime (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 SetSystemTime in other DLLs exists, click on Find References to the right.
.
C# Signature:
[DllImport("coredll.dll", SetLastError=true)]
static extern TODO SetSystemTime(TODO);
VB Signature:
<DllImport("coredll.dll")> _
Private Shared Function SetSystemTime(ByRef time As SYSTEMTIME) As Boolean
End Function
User-Defined Types:
None.
Notes:
None.
Tips & Tricks:
Please add some!
Sample Code:
Imports System.Runtime.InteropServices
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
MyBase.Dispose(disposing)
End Sub
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.Button1 = New System.Windows.Forms.Button
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(56, 160)
Me.Button1.Size = New System.Drawing.Size(128, 64)
Me.Button1.Text = "Button1"
'
'Form1
'
Me.Controls.Add(Me.Button1)
Me.Menu = Me.MainMenu1
Me.Text = "Form1"
End Sub
#End Region
Private Structure SYSTEMTIME
Public Year As Short
Public Month As Short
Public DayOfWeek As Short
Public Day As Short
Public Hour As Short
Public Minute As Short
Public Second As Short
Public Milliseconds As Short
End Structure
<DllImport("coredll.dll")> _
Private Shared Function SetSystemTime(ByRef time As SYSTEMTIME) As Boolean
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim idag As DateTime = Now().AddHours(1).AddMinutes(2).ToUniversalTime
Dim s As New SYSTEMTIME
s.Year = idag.Year
s.Month = idag.Month
s.DayOfWeek = idag.DayOfWeek
s.Day = idag.Day
s.Hour = idag.Hour
s.Minute = idag.Minute
s.Second = idag.Second
s.Milliseconds = idag.Millisecond
SetSystemTime(s)
End Sub
End Class
Alternative Managed API:
Do you know one? Please contribute it!
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).