Loading
Multi column listview control in a Basic MSI project
I am trying to implement a multi column listview control in a Basic MSI project, but there doesn't seem to be any documentation for doing so.

 

I am able to add an entry to the listview control much like a listbox:

 

sQuery = "SELECT * FROM ListView WHERE Property='MYLIST'";

 

nReturn = MsiDatabaseOpenView(hDB, sQuery, hView);

 

hRec = MsiCreateRecord(5);

 

MsiRecordSetString(hRec, 1, 'MYLIST');

 

MsiRecordSetInteger(hRec, 2, 1);

 

MsiRecordSetString(hRec, 3, "Item 1");

 

MsiRecordSetString(hRec, 4, "Item 1");

 

MsiRecordSetString(hRec, 5, "");

 

MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);

 

MsiCloseHandle(hRec);

 

MsiViewClose(hView);

 

However, I do not see a way to do any of the following:

 

Add multiple column entries

 

Set the column widths

 

Add column headers

 

Display an icon in a column

 

Does anyone know if any of these things are possible?

  • Community Manager (Flexera Software)

    Alas, no: according to the MSI topic "ListView Control", it's a single column of data with an icon next to each value.
  • Then how is it that the SdDiskSpace2 (Requirements) dialog has a ListView control with multiple columns/headers?

     

    I am desperately looking for an example of how to do this with InstallScriptMSI project
  • Community Manager (Flexera Software)

    The original question and restriction were about Basic MSI; with InstallScript or InstallScript MSI, you have a bit more flexibility.

     

    I haven't tried it, but see for example [thread=127075]this thread[/thread] for what claims to be InstallScript wrappers around the Windows API functions for working with a list-view...
    Expand Post

Loading
Multi column listview control in a Basic MSI project