Attribute VB_Name = "Startup"
Option Explicit


Global bStartup As Boolean
Global LangID   As Integer
Global LanFile As String

Public Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long


Sub Main()

    If App.PrevInstance Then
        End
    End If
    
    ' select system language 2002/11/10
    If Command() <> "ENGLISH" Then
        LangID = GetSystemDefaultLangID()
        Select Case LangID
            Case &H411
                LanFile = GetSetting(App.Title, "Language1", "LangFile", "Japanese.txt")
            Case &H404
                LanFile = GetSetting(App.Title, "Language1", "LangFile", "Chinese-TW.txt")
            Case Else
                LanFile = GetSetting(App.Title, "Language1", "LangFile", "English-US.txt")
        End Select
    Else
        LanFile = GetSetting(App.Title, "Language1", "LangFile", "English-US.txt")
    End If
    
    SetLanguageProfile App.Path + "\Language\" + LanFile
    
    'frmMain.Show 'Mark by bygone 20040504 不會顯示一個視窗後再消失
    Load frmMain
    frmMain.Visible = False
End Sub


