Attribute VB_Name = "mod_Security"
Option Explicit

Sub Security_Load()
    Dim lngloop As Long
    Dim strFile As String
    Dim myCounter As Long
    Dim strID As String
    Dim strSection As String
    Dim myKomma As Long
    Dim strTemp As String
    Dim strLine As String
    
    frmMain.File1.Pattern = "*.skn"
    frmMain.File1.Path = strProgramdir & Left(strThemedir, Len(strThemedir) - 1)
    
    frmMain.lstBox(1).Clear
    For lngloop = 0 To frmMain.File1.ListCount - 1
        strFile = strProgramdir & strThemedir & frmMain.File1.List(lngloop)
        myCounter = 0
        'frmMain.lstBox(1).AddItem frmMain.File1.List(lngLoop)
        While INI_GetKey("SECURITY", Format(myCounter + 1, "00"), strFile) = True
            If myCounter = 0 Then
                frmMain.lstBox(1).AddItem UCase(Left(frmMain.File1.List(lngloop), Len(frmMain.File1.List(lngloop)) - 4))
            End If
            strID = Left(iniValue, 2)
            strLine = Mid(iniValue, 4)
            myKomma = InStr(strLine, " ")
            strSection = Left(strLine, myKomma - 1)
            strTemp = Mid(strFile, 1, Len(strFile) - 3)
            INI_GetKey strSection, strID, strTemp & "ini"
            If iniValue = "" Then
                INI_GetKey strSection, strID, strTemp & "skn"
            End If
            myKomma = InStr(iniValue, ",")
            iniValue = Mid(iniValue, myKomma + 1)
            myKomma = InStr(iniValue, ",")
            iniValue = Mid(iniValue, myKomma + 1)
            myKomma = InStr(iniValue, ",")
            iniValue = Mid(iniValue, myKomma + 1)
            myKomma = InStr(iniValue, ",")
            iniValue = Mid(iniValue, myKomma + 1)
            myKomma = InStr(iniValue, ",")
            iniValue = Mid(iniValue, myKomma + 1)
            myKomma = InStr(iniValue, ",")
            iniValue = Mid(iniValue, myKomma + 1)
            myKomma = InStr(iniValue, ",")
            iniValue = Mid(iniValue, myKomma + 1)
            myKomma = InStr(iniValue, ",")
            iniValue = Mid(iniValue, myKomma + 1)
            myKomma = InStr(iniValue, ",")
            If UCase(Mid(iniValue, 1, myKomma - 1)) = "FALSE" Then
                strLine = "False : " & strLine
            Else
                strLine = "True  : " & strLine
            End If
            frmMain.lstBox(1).AddItem "  " & strLine
            frmMain.lstBox(1).ItemData(frmMain.lstBox(1).NewIndex) = strID
            myCounter = myCounter + 1
        Wend
    Next
    
    frmMain.lstBox(3).Clear
    myCounter = 0
    strFile = strProgramdir & strThemedir & "terminal.skn"
    While INI_GetKey("GLOBAL", Format(myCounter + 1, "00"), strFile) = True
        strLine = iniValue
        myKomma = InStr(strLine, " ")
        strSection = Left(strLine, myKomma - 1)
        If (Right(strSection, 1) = ":") Then strSection = Mid(strSection, 1, Len(strSection) - 1)
        INI_GetKey "DEFAULT", strSection, strFile
        If UCase(iniValue) = "FALSE" Then
            strLine = "OFF   : " & strLine
        Else
            strLine = "ON    : " & strLine
        End If
        frmMain.lstBox(3).AddItem "  " & strLine
        myCounter = myCounter + 1
    Wend
    
End Sub

Public Sub Theme_Load()
    Dim lngloop As Long
    
    frmMain.lstBox(2).Clear
    frmMain.File1.Pattern = "*.bmp"
    frmMain.File1.Path = strProgramdir & "\Themes"
    For lngloop = 0 To frmMain.File1.ListCount - 1
        frmMain.lstBox(2).AddItem Mid(frmMain.File1.List(lngloop), 1, Len(frmMain.File1.List(lngloop)) - 4)
    Next
End Sub
