IAppPublisher::GetCategories method

Retrieves a structure listing the categories provided by an application publisher.

Syntax


HRESULT GetCategories(
  [out] APPCATEGORYINFOLIST *pInfoList
);

Parameters

pInfoList [out]

Type: APPCATEGORYINFOLIST*

A pointer to an APPCATEGORYINFOLIST structure. This structure's cCategory member returns the count of supported categories. The pCategoryInfo member returns a pointer to an array of APPCATEGORYINFO structures. This array contains all the categories an application publisher supports and must be allocated using CoTaskMemAlloc and freed using CoTaskMemFree.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The Add/Remove Programs Control Panel Application passes the ID returned for a category to the IAppPublisher::EnumApps method to identify which category is to be enumerated.

Examples

The following example shows how to calculate the size of the array of APPCATEGORYINFO structures that is returned by IAppPublisher::GetCategories.


size_t CategoryListArraySize = sizeof(APPCATEGORYINFO) * pInfoList->cCategory;

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Shappmgr.h

IDL

Shappmgr.idl

See also

IAppPublisher
APPCATEGORYINFO
APPCATEGORYINFOLIST

 

 

Show: