Basically, you need to set/get Object into/from Items property of TComboBox instance. An example could be found at TComboBox.Items Property[^] To set:
// Add View styles and constants to the Combo Box
ComboBox1.Items.AddObject('vsIcon', TObject(vsIcon));
ComboBox1.Items.AddObject('vsList', TObject(vsList));
ComboBox1.Items.AddObject('vsReport', TObject(vsReport));
ComboBox1.Items.AddObject('vsSmallIcon', TObject(vsSmallIcon));
// Display first item in the Combo Box
ComboBox1.ItemIndex := 0;
To get:
ListView1.ViewStyle := TViewStyle(Items.Objects[ItemIndex]);
TComboBox uses an instance of TCustomComboBoxStrings to maintain captions and their associated data, which has a function called PutObject.
function PutObject(Index: Integer; AObject: TObject); override;
This is the function that sends CB_SETITEMDATA message internally and where you could be able to set 32-bit value along with a given item index. On the other hand, GetObject
function GetObject(Index: Integer): TObject;
will retrieve the 32-bit value for you. Notice, in the world of Delphi, all these 32-bit values here are actually a TObject value.