Thanks Al. This example is a big help. There was one change that I needed to make which I wanted to pass on to you. The list box has numeric item entries 1 to 4. I wasn't able to highlight the 4. It had to do with how the value for the SetCtrlVal was calculated at the end of the ListBoxCallback routine. I made the following changes to the last couple of lines of the routine:
// your existing code
if (nPointedToItem < 1)
nPointedToItem = 1;
if (nPointedToItem > nListLines)
nPointedToItem = nListLines;
// I added this line (lineNum is new int variable)
// to find out which item is displayed on the first
// line of the list box
GetCtrlAttribute(panel, PANEL_LISTBOX, ATTR_FIRST_VISIBLE_LINE, &lineNum);
// the value returned fro
m previous call is added to
// value calculated by the mouse position, hence the
// proper item in the listbox is highlighted.
SetCtrlVal (panel, PANEL_LISTBOX, (int) floor(nPointedToItem)+lineNum);
I realize that you may never need this example again, but I thought I'd pass along my modification in case you were interested. I really appreciate your taking your time to come up with this example for me. Thanks again.