The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Grincheux on March 23, 2005, 09:40:42 PM

Title: LB_SETTOPINDEX
Post by: Grincheux on March 23, 2005, 09:40:42 PM
 :naughty:

Microsoft says : "An application sends an LB_SETTOPINDEX message to ensure that a particular item in a list box is visible."

That's right if the listbox has no more than 32767 items.
In my listobx I have 50000 strings.
How is it possible that LB_SETTOPINDEX works fine with more than 32767 strings.
Title: Re: LB_SETTOPINDEX
Post by: 00100b on March 24, 2005, 11:55:27 AM
Looking at the descriptions of the LB_SETTOPINDEX and LB_INITSTORAGE, I don't think that a List class was ever meant to hold more than 32767 items.

Now, those same MSDN topics on those messages does specifically place the text for that limitation under a Win95/98 sub-heading, but there is also nothing specifically stated concerning this allocation for NT and above.

What happens is that you get a sign roll-over when you have items starting at an ordinal of 32768.
Title: Re: LB_SETTOPINDEX
Post by: Grincheux on March 24, 2005, 12:16:31 PM
The first selected item is not a the top of the listbox instead this message.
If the first selected item is in te range 1..32767 the item is correctly displayed.
In the listbox I have the "Not Integral height" parameter set.

Before initializing the listbox I have used the LB_INITSTORAGE for 50 000 strings of 80 characters length.

Thanks