Not a Member Yet,
Click here to Register
How do you like the new design?
It's cool, great job
[tally: 70%] 70%
It's okay
[tally: 20%] 20%
Its OK but I liked the old layout better
[tally: 0%] 0%
Please bring the old one back
[tally: 10%] 10%

votes: 10

ID: 172
Viewed: 2284
Added: Apr 29, 2002
Version:
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

Change Computer Time / Date

Highlight all by clicking in box
<!---Declaration--->
Option Explicit

Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

Private Declare Function SetSystemTime Lib "kernel32" _
(lpSystemTime As SYSTEMTIME) As Long
Private Const WM_TIMECHANGE = &H1E

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long

Private Const HWND_TOPMOST = -1

Highlight All
<!---Code--->
Private Sub Command1_Click()
Dim dwret As Long
Dim st As SYSTEMTIME

With st
.wYear = 1999
.wMonth = 9
.wDay = 1
.wHour = 16
.wMinute = 0
.wSecond = 0
.wMilliseconds = 0
End With

dwret = SetSystemTime(st)
If dwret = 1 Then
'
' This updates the Windows displaying the system time
'
Call SendMessage(HWND_TOPMOST, WM_TIMECHANGE, 0, 0)
End If
End Sub
;


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2017 snippetlibrary.com All Rights Reserved. Conditions