Results 1 to 4 of 4

Thread: SetSystemTime in Windows NT

  1. #1

    Thread Starter
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    it's fine with NT, heres the code:
    Code:
    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 Declare Sub GetSystemTime _
    Lib "kernel32" (lpSystemTime As SYSTEMTIME)
    
    Private Sub Command1_Click()
    Dim oldtime As SYSTEMTIME
    GetSystemTime oldtime
    End Sub
    
    Private Sub Command2_Click()
    Dim tNew As SYSTEMTIME
    Dim lRet&
    With tNew
        .wDay = 20
        .wDayOfWeek = 0
        .wHour = 7
        .wMilliseconds = 12
        .wMinute = 30
        .wMonth = 5
        .wSecond = 21
        .wYear = 2001
    End With
    lRet = SetSystemTime(tNew)
    End Sub
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  2. #2
    New Member
    Join Date
    May 2001
    Posts
    2
    Thanks, but i know how to call the function.
    I'm not actually using VB, but it should work and it does work on windows 98, just not NT.

  3. #3

    Thread Starter
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    works for me on NT, do you have rights to change the time?
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  4. #4
    New Member
    Join Date
    May 2001
    Posts
    2
    No i don't. That's the reason i made the prog to try to change the time, heh. I thought it would work. That explains it then ;[

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width