Public Class Form1 Dim mHandler As TimerEventHandler Dim iCount As Long = 0 Dim mTimerId As Integer <DllImport("winmm.dll")> Private Shared Function timeSetEvent(delay As Integer, resolution As Integer, handler As TimerEventHandler, user As IntPtr, eventType As Integer) As Integer End Function <DllImport("winmm.dll")> Private Shared Function timeBeginPeriod(millisecond As Integer) As Integer End Function Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click timeBeginPeriod(1) mHandler = New TimerEventHandler(AddressOf TimerCallback) mTimerId = timeSetEvent(1, 0, mHandler, IntPtr.Zero, 1) End Sub Private Delegate Sub TimerEventHandler(id As Integer, msg As Integer, user As IntPtr, dw1 As Integer, dw2 As Integer) Private Sub TimerCallback(id As Integer, msg As Integer, user As IntPtr, dw1 As Integer, dw2 As Integer) iCount += 1 End Sub End Class
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE