View Full Version : Populating lists, combo boxes

07-21-2006, 01:32 PM
I've seen a number of scripts on here for populating listboxes, listviews and comboboxes. I believe I understand how they work but I seem to be short one bit of information that isn't obvious and I cannot seem to find.

How does one determine what the ID number of a control on a dialog is? There doesn't appear to be a control ID property on any of the controls I've placed on my dialog.

Looking in the Direct Editor's Control list I do see my listview and I do see a field named ISControlId, however, all of the controls in that table appear to be blank. As a test I assigned my control 1234 in that field, but that doesn't appear to work. The listbox and listview tables in the direct editor appear to be empty.

My listbox is still empty, even though when I debug I can see my script run.

Any ideas?

07-21-2006, 02:01 PM
What type of project? What's the script you're using to populate the list box or combo box?

07-21-2006, 02:54 PM
I'm doing a basic MSI project in the IS ide and I'm currently trying to populate a listbox with some test data.

I am calling my script just before InstallWelcome using a custom action.

This is my function...

LIST requirementList;
int listboxId;

requirementList = ListCreate( STRINGLIST );
ListAddString( requirementList, "TEST", AFTER );
ListAddString( requirementList, "TEST 2", AFTER );
ListAddString( requirementList, "TEST 3", AFTER );

CtrlSetList( "CUSTOMDIALOGTEST", listboxId, requirementList );


07-21-2006, 02:56 PM
For Basic MSI, you'll want to add the values at design time in the dialog editor (if they're constant), or populate the list box at run time by accessing the in-memory MSI database, as described in this DevLetter tip: http://www.macrovision.com/company/news/newsletter/tips/msiaccess.shtml.