wpQueryIconData - How to Override

Workplace classes that wish to have a unique icon for each instance must override this method and fill out the appropriate fields within the ICONINFO structure. In addition, the correct size for the ICONINFO must always be returned.

This example shows how to override wpQueryIconData by returning information about the icon associated with the instance if pIconInfo is not NULL.

SOM_Scope ULONG SOMLINK Calendar_wpQueryIconData(_Calendar *somSelf,
                                                 PICONINFO pIconInfo)
{
  _CalendarData *somThis = _CalendarGetData(somSelf);
  _CalendarMethodDebug("_Calendar","myf_wpQueryIconData");

  if (pIconInfo)
  {
    pIconInfo->fFormat = ICON_RESOURCE;
    pIconInfo->hmod    = _clsQueryModuleHandle(_somGetClass(somSelf));
    pIconInfo->resid   = ID_ICON;
  } /* endif */
  return (sizeof(ICONINFO));
}


[Back: wpQueryIconData - Usage]
[Next: wpQueryIconData - Related Methods]