settimer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ligi168

    settimer

    Hi!The api funtion "settimer" is all right used in windows xp/2003
    server,but it will cause a conflict when it is used in windows nt 4.0
    My code(vba) as following:
    ////////////////////////////////////////
    Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent
    As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
    Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent
    As Long) As Long
    Public Id_Timer As Long
    Public Sub StarTimer()
    Id_Timer = SetTimer(0, Id_Timer, 1000, AddressOf timeProc)

    End Sub
    Public Sub timeProc()

    Application.Sta tusBar = Now
    End Sub

    //////////////////////////////////////////////

    Thanks.
    Agan


  • Willy Denoyette [MVP]

    #2
    Re: settimer

    Better post VB.NET reated questions to microsoft.publi c.dotnet.langua ges.vb

    Willy.

    "ligi168" <ligi168@163.co m> wrote in message news:uvPEnTEpDH A.2808@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hi!The api funtion "settimer" is all right used in windows xp/2003
    > server,but it will cause a conflict when it is used in windows nt 4.0
    > My code(vba) as following:
    > ////////////////////////////////////////
    > Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent
    > As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
    > Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent
    > As Long) As Long
    > Public Id_Timer As Long
    > Public Sub StarTimer()
    > Id_Timer = SetTimer(0, Id_Timer, 1000, AddressOf timeProc)
    >
    > End Sub
    > Public Sub timeProc()
    >
    > Application.Sta tusBar = Now
    > End Sub
    >
    > //////////////////////////////////////////////
    >
    > Thanks.
    > Agan
    >
    >[/color]


    Comment

    Working...