func (lb *ListBox) GetItemData(index int) (data uintptr, err error) {
	ret := lb.SendMessage(win.LB_GETITEMDATA, uintptr(index), 0)
	if int(ret) < 0 {
		err = errors.New("GetItemData error")
	} else {
		data = ret
	}
	return
}
GetItemData gets the application-defined value associated with the specified list box item.
package wingui
import (
	"errors"
	"github.com/lxn/win"
	"log"
	"syscall"
	"unsafe"
)
type ListBox struct {
	WindowBase
	OnDoubleClick func()
	OnSelChange   func()
}
func NewListBox(idd uintptr) *ListBox {
	return &ListBox{
		WindowBase: WindowBase{idd: idd},
	}
}
func BindNewListBox(idd uintptr, dlg *Dialog) (*ListBox, error) {
	b := NewListBox(idd)
	err := dlg.BindWidgets(b)
	return b, err
}
func (lb *ListBox) WndProc(msg uint32, wParam, lParam uintptr) uintptr {
	switch msg {
	case win.WM_COMMAND:
		cmdCode := win.HIWORD(uint32(wParam))
		switch cmdCode {
		case win.LBN_DBLCLK:
			if lb.OnDoubleClick != nil {
				lb.OnDoubleClick()
			}
		case win.LBN_SELCHANGE:
			if lb.OnSelChange != nil {
				lb.OnSelChange()
			}
		}
	}
	return lb.AsWindowBase().WndProc(msg, wParam, lParam)
}
func (lb *ListBox) GetCurSel() int {
	return int(int32(lb.SendMessage(win.LB_GETCURSEL, 0, 0)))
}
func (lb *ListBox) SetCurSel(idx int) error {
	index := int(int32(lb.SendMessage(win.LB_SETCURSEL, uintptr(idx), 0)))
	if index != idx {
		return errors.New("invalid index")
	}
	return nil
}
func (lb *ListBox) SetSel(idx int, sel bool) error {
	ret := lb.SendMessage(win.LB_SETSEL, uintptr(win.BoolToBOOL(sel)), uintptr(idx))
	if int(ret) == win.LB_ERR {
		return errors.New("ListBox setsel error")
	}
	return nil
}
func (lb *ListBox) GetSel(idx int) bool {
	ret := lb.SendMessage(win.LB_GETSEL, uintptr(idx), 0)
	return int(ret) > 0
}
func (lb *ListBox) GetSelectedIndexes() []int {
	count := lb.SendMessage(win.LB_GETSELCOUNT, 0, 0)
	if int(count) < 1 {
		return nil
	}
	index32 := make([]int32, count)
	if n := int(int32(lb.SendMessage(win.LB_GETSELITEMS, count, uintptr(unsafe.Pointer(&index32[0]))))); n == win.LB_ERR {
		return nil
	} else {
		indexes := make([]int, n)
		for i := 0; i < n; i++ {
			indexes[i] = int(index32[i])
		}
		return indexes
	}
}
func (lb *ListBox) GetCount() int {
	return int(int32(lb.SendMessage(win.LB_GETCOUNT, 0, 0)))
}