Imports System.Windows.Forms
Imports FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME

Public Class VBNetDemo

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Dim ft As FILETIME
        Dim dt As FILETIME
        Dim bResult As Integer
        Dim szStatus As String
        Dim x As Long

        Me.ListBox1.Items.Clear()

        For x = 0 To 250
            GetSystemTimeAsFileTime(ft)
            bResult = GetDomainTimeAsFileTime(dt)
            If bResult Then szStatus = "high resolution" Else szStatus = "system resolution"
            Me.ListBox1.Items.Add("OS=" & ft.dwHighDateTime & ":" & ft.dwLowDateTime & "    DT=" & dt.dwHighDateTime & ":" & dt.dwLowDateTime & " - " & szStatus)
        Next

    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub Dialog1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Text = "VB.NET Demo"
    End Sub
End Class
