Какие возможности предоставляет обыкновенный такой ЛискБокс через функцию
SendMessage?
Я уже понял что так он работает гораздо быстрее чем через свои методы
Задаю вопрос потомучто у меня не получилось передать и получить из него
строковые значения
Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long
hwnd - ListBox.hwnd
Const LB_DELETESTRING As Long = &H182
Const LB_GETCOUNT As Long = &H18B
Const LB_GETTEXTLEN As Long = &H18A
Const LB_SETHORIZONTALEXTENT = &H194
lngCurrent = SendMessage(hwnd, LB_GETTEXTLEN, lngIndex, 0)
SendMessage hwnd, LB_SETHORIZONTALEXTENT, lngMax / Screen.TwipsPerPixelX, 0
lngCount = SendMessage(hwnd, LB_GETCOUNT, 0, 0)
SendMessage lstFiles.hwnd, LB_DELETESTRING, lngIndex, 0
Это я умею.
Хотелось бы узнать как добавлять строки и как получать из них значения в
переменную.
Как использовать эти константы? Приведите пример.
Const LB_ADDSTRING As Long = &H180
Const LB_FINDSTRING As Long = &H18F
Const LB_GETTEXT As Long = &H189
Const LB_GETTEXTLEN As Long = &H18A
По возможности еще и для этих что-нибудь подкиньте :)
Const LB_ADDFILE As Long = &H196
Const LB_CTLCODE As Long = 0&
Const LB_DIR As Long = &H18D
Const LB_DST_ADDR_USE_DSTADDR_FLAG As Long = &H8
Const LB_DST_ADDR_USE_SRCADDR_FLAG As Long = &H4
Const LB_DST_MASK_LATE_FLAG As Long = &H20
Const LB_ERR As Long = (-1)
Const LB_ERRSPACE As Long = (-2)
Const LB_FINDSTRINGEXACT As Long = &H1A2
Const LB_GETANCHORINDEX As Long = &H19D
Const LB_GETCARETINDEX As Long = &H19F
Const LB_GETCURSEL As Long = &H188
Const LB_GETHORIZONTALEXTENT As Long = &H193
Const LB_GETITEMDATA As Long = &H199
Const LB_GETITEMHEIGHT As Long = &H1A1
Const LB_GETITEMRECT As Long = &H198
Const LB_GETLOCALE As Long = &H1A6
Const LB_GETSEL As Long = &H187
Const LB_GETSELCOUNT As Long = &H190
Const LB_GETSELITEMS As Long = &H191
Const LB_GETTOPINDEX As Long = &H18E
Const LB_INITSTORAGE As Long = &H1A8
Const LB_INSERTSTRING As Long = &H181
Const LB_ITEMFROMPOINT As Long = &H1A9
Const LB_MSGMAX As Long = &H1A8
Const LB_MULTIPLEADDSTRING As Long = &H1B1
Const LB_OKAY As Long = 0
Const LB_RESETCONTENT As Long = &H184
Const LB_SELECTSTRING As Long = &H18C
Const LB_SELITEMRANGE As Long = &H19B
Const LB_SELITEMRANGEEX As Long = &H183
Const LB_SETANCHORINDEX As Long = &H19C
Const LB_SETCARETINDEX As Long = &H19E
Const LB_SETCOLUMNWIDTH As Long = &H195
Const LB_SETCOUNT As Long = &H1A7
Const LB_SETCURSEL As Long = &H186
Const LB_SETHORIZONTALEXTENT As Long = &H194
Const LB_SETITEMDATA As Long = &H19A
Const LB_SETITEMHEIGHT As Long = &H1A0
Const LB_SETLOCALE As Long = &H1A5
Const LB_SETSEL As Long = &H185
Const LB_SETTABSTOPS As Long = &H192
Const LB_SETTOPINDEX As Long = &H197
Const LB_SRC_ADDR_USE_DSTADDR_FLAG As Long = &H2
Const LB_SRC_ADDR_USE_SRCADDR_FLAG As Long = &H1
Const LB_SRC_MASK_LATE_FLAG As Long = &H10
Ответить
|