November 4, 2000

ListBoxSelectRange – Select or unselect a range of elements in a ListBox

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Declare Sub CopyMemory Lib “kernel32” Alias “RtlMoveMemory” (dest As _ Any, dest As Any, ByVal numBytes As Long)Const LB_SELITEMRANGE = &H19B’ Select or

GetListItemHeight – Return the height of a ListBox or ComboBox item

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongConst LB_GETITEMHEIGHT = &H1A1Const CB_GETITEMHEIGHT = &H154′ Return the height of each entry in a ListBox or ComboBox control (in pixels)Function GetListItemHeight(ctrl As Control)

ListBoxVisibleItems – The number of visible items in a ListBox control

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Declare Function GetClientRect Lib “user32” (ByVal hwnd As Long, _ lpRect As RECT) As LongConst LB_GETITEMHEIGHT = &H1A1Type RECT Left As Long Top

SetListItemHeight – Change the height of items in a ListBox or ComboBox control

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongConst LB_SETITEMHEIGHT = &H1A0Const CB_SETITEMHEIGHT = &H153′ Set the height in pixels of each entry in a ListBox or ComboBox controlSub SetListItemHeight(ctrl As Control,

DuplicateListBox – Fast copy of the contents of a ListBox control

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Declare Function LockWindowUpdate Lib “user32” (ByVal hwndLock As Long) _ As Long Const LB_RESETCONTENT = &H184Const LB_GETCOUNT = &H18BConst LB_GETTEXT = &H189Const LB_ADDSTRING

DuplicateComboBox – Fast copy of the contents of a ComboBox control

Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal _ hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ lParam As Any) As LongPrivate Declare Function LockWindowUpdate Lib “user32” (ByVal hwndLock As Long) _ As Long Const CB_RESETCONTENT = &H14BConst CB_GETCOUNT = &H146Const CB_GETITEMDATA = &H150Const CB_SETITEMDATA