For Microsoft Windows versions prior to XP, a ListView control cannot display items in groups. For this reason, the sample code checks the OS version and OS feature-set. If the client OS is XP or later and the feature-set includes Themes, contacts are loaded into groups. Otherwise, the example code uses the IMessenger::MyContacts property to load the contacts directly into the ListView control without grouping.

Copy Code
Application.EnableVisualStyles();
bool isRunningXPOrLater = OSFeature.Feature.IsPresent(OSFeature.Themes);
...
if (isRunningXPOrLater == true &&
OSFeature.Feature.IsPresent(OSFeature.Themes))
{
 // contact group code
...
}
else
{
 // contact list code
 ...
}

See Also