[API]
GetDlgItem

[INCLUDE]
SendMessage
SendMessage_String

[CODE]
Public Sub LoadResEx_Dialog_ListFill(ByVal DialogHWnd As Long, ByVal ControlID As Long, ByVal ResIDFirstString As Long, ByVal ResIDLastString As Long)
  ControlID = GetDlgItem(DialogHWnd, ControlID)
  If Not ControlID = 0& Then
    For ResIDFirstString = ResIDFirstString To ResIDLastString
      Call SendMessage_String(ControlID, &H143&, 0&, LoadResEx_String(ResIDFirstString))
      Next
    End If
  End Sub

Public Function LoadResEx_Dialog_ListIndex(ByVal DialogHWnd As Long, ByVal ControlID As Long, ByRef Value As Long, Optional ByVal ReadFromDialog As Boolean = False) As Boolean
  ControlID = GetDlgItem(DialogHWnd, ControlID)
  If Not ControlID = 0& Then
    If ReadFromDialog Then
      ControlID = SendMessage(ControlID, &H188&, 0&, 0&)
      If Not ControlID = Value Then
        Value = ControlID
        LoadResEx_Dialog_ListIndex = True
        End If
      Else
      Call SendMessage(ControlID, &H186&, Value, 0&)
      End If
    End If
  End Function

Public Function LoadResEx_Dialog_ListIndexCB(ByVal DialogHWnd As Long, ByVal ControlID As Long, ByRef Value As Long, Optional ByVal ReadFromDialog As Boolean = False) As Boolean
  ControlID = GetDlgItem(DialogHWnd, ControlID)
  If Not ControlID = 0& Then
    If ReadFromDialog Then
      ControlID = SendMessage(ControlID, &H147&, 0&, 0&)
      If Not ControlID = Value Then
        Value = ControlID
        LoadResEx_Dialog_ListIndexCB = True
        End If
      Else
      Call SendMessage(ControlID, &H14E&, Value, 0&)
      End If
    End If
  End Function

Public Sub LoadResEx_Dialog_ListIndexMS(ByVal DialogHWnd As Long, ByVal ControlID As Long, ByVal Value As Long)
  ControlID = GetDlgItem(DialogHWnd, ControlID)
  If Not ControlID = 0& Then
    Call SendMessage(ControlID, &H185, 0&, -1&)
    Call SendMessage(ControlID, &H185, 1&, Value)
    Call SendMessage(ControlID, &H186, 1&, Value)
    Call SendMessage(ControlID, &H14E&, Value, 0&)
    End If
  End Sub
