Bug in TCustomListBox.GetItemIndex

I have found a bug in the Delphi 4.0 StdCtrls unit. The
TCustomListBox.GetItemIndex method incorrectly sends the LB_GETCURSEL
message when it should send the LB_GETCARETINDEX message, and vice versa.

The problem becomes that GetItemIndex will never return -1. For
single-selection listboxes, even if the true index value of the windows
listbox control is -1, GetItemIndex will return 0. This means that you
cannot use "ItemIndex <> -1" to see if an item is selected. You also cannot
programatically set ItemIndex to 0 without first setting it to something
greater than 0 because of the interaction with SetItemIndex which checks
GetItemIndex before attempting to send the Windows message to set the index.

Some of the problems I've noticed were when:
1. Loading strings into a listbox and highlighting the first item
2. Checking to see if a listbox item is selected

I've already submitted this bug to Inprise.

Piper