GetManagedApplications function (appmgmt.h)
The GetManagedApplications function gets a list of applications that are displayed in the Add pane of Add/Remove Programs (ARP) for a specified user context.
Syntax
DWORD GetManagedApplications(
[in] GUID *pCategory,
[in] DWORD dwQueryFlags,
[in] DWORD dwInfoLevel,
[out] LPDWORD pdwApps,
[out] PMANAGEDAPPLICATION *prgManagedApps
);
Parameters
[in] pCategory
A pointer to a GUID that specifies the category
of applications to be listed. If pCategory is not null, dwQueryFlags must contain MANAGED_APPS_FROMCATEGORY. If pCategory is null, dwQueryFlags cannot contain MANAGED_APPS_FROMCATEGORY.
[in] dwQueryFlags
This parameter can contain one or more of the following values.
MANAGED_APPS_USERAPPLICATIONS
Lists all applications that apply to the user. The parameter pCategory must be null.
MANAGED_APPS_FROMCATEGORY
Lists only applications in the category specified by pCategory. The pCategory parameter cannot be null.
[in] dwInfoLevel
This parameter must be MANAGED_APPS_INFOLEVEL_DEFAULT.
[out] pdwApps
The count of applications in the list returned by this function.
[out] prgManagedApps
This parameter is a pointer to an array of MANAGEDAPPLICATION structures. This array contains the list of applications listed in the Add pane of Add/Remove Programs (ARP). You must call LocalFree to free the array when they array is no longer required.
Return value
If the function succeeds, the return value is ERROR_SUCCESS. Otherwise, the function returns one of the system error codes. For a complete list of error codes, see System Error Codes or the header file WinError.h.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | appmgmt.h |
Library | Advapi32.lib |
DLL | Advapi32.dll |