.
I' Not Clear You SourceCode only Relate the imagelist with ListView
Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
Private Const LOCALE_SYSTEM_DEFAULT As Long = &H400
Private Const LOCALE_SENGCOUNTRY = &H1002
Private objCnSRes As Object
Private Sub Command1_Click()
With Lv.ListItems.Add(, , "aaa", GetFlag(GetCountry), GetFlag(GetCountry))
.SubItems(1) = "0.0.0.0"
.SubItems(2) = "1111"
End With
End Sub
Private Sub Form_Load()
Dim lvitem As ListItem
With Lv
' Initialize ImageList
Set objCnSRes = CreateObject("Flags.cRec")
' // In the DLL Declare CountImages ( Cant of Images ),
For lng_i = 1 To objCnSRes.CountImages
' // is added 100 for the id of the image resources
Call img.ListImages.Add(, , objCnSRes.GetPicture(lng_i+100, GIF))
Next lng_i
Set objCnSRes = Nothing
.Icons = img 'Relate ImageList With The ListView.
.View = lvwReport
Call .ColumnHeaders.Add(, , ".#.", 2000, vbLeftJustify)
Call .ColumnHeaders.Add(, , "Proxy IP ", 2000, vbLeftJustify)
Call .ColumnHeaders.Add(, , "Port", 1300, vbLeftJustify)
End With
End Sub
Public Function GetCountry() As String
Dim sName As String * 256, lBuffSize As Long
lBuffSize = GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGCOUNTRY, ByVal sName, Len(sName))
GetCountry = Left(sName, lBuffSize - 1)
End Function
Public Function GetFlag(sCountry As String) As Long
Select Case LCase(sCountry)
Case "greece"
GetFlag = 1
Case "argentina"
GetFlag = 2
Case "mexico" ' // This my State
GetFlag = 1
'Case Else
'GetFlag = 0 ' // Case Defaul Image
End Select
End Function
Dulce Infierno Lunar!¡.
.