Option Explicit
Option Base 1

Sub Form_DblClick ()

    'If 1 or more new messages, display them
    If NewMessage > 0 Then
	DisplaySubjects
    End If
End Sub

Sub Form_Load ()

    Dim count As Integer
    Dim ccode As Integer
    Dim user As String

    'Scan every 45 seconds
    MHSTimer.Interval = 45000

    'Get the user's login name and MHS directory
    MHSDirectory = GetMHSDirectory(user)

    'Read the application out of netdir.tab
    ccode = ReadUserData(MHSDirectory & "MHS\MAIL\PUBLIC\netdir.tab", user, userApplication)
    
    MHSDirectory = MHSDirectory & "MHS\MAIL\USERS\" & user & "\" & userApplication & "\"
    
    'Return the number of new messages and display it
    count = ScanNewMail()
    NewMessage = count
    
End Sub

Sub MHSTimer_Timer ()

    Dim count As Integer

    count = ScanNewMail()

    NewMessage = count

End Sub

