GetLocalManagedApplications function (appmgmt.h)

The GetLocalManagedApplications function can be run on the target computer to get a list of managed applications on that computer. The function can also be called in the context of a user to get a list of managed applications for that user. This function only returns applications that can be installed by the Windows Installer.

Syntax

DWORD GetLocalManagedApplications(
  [in]  BOOL                     bUserApps,
  [out] LPDWORD                  pdwApps,
  [out] PLOCALMANAGEDAPPLICATION *prgLocalApps
);

Parameters

[in] bUserApps

A value that, if TRUE, the prgLocalApps parameter contains a list of managed applications that applies to the user. If the value of this parameter is FALSE, the prgLocalApps parameter contains a list of managed applications that applies to the local computer.

[out] pdwApps

The address of a DWORD that specifies the number of applications in the list returned by prgLocalApps.

[out] prgLocalApps

The address of an array that contains the list of managed applications. You must call LocalFree to free this array when its contents are no longer required. This parameter cannot be null. The list is returned as a LOCALMANAGEDAPPLICATION structure.

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

See also

Group Policy Functions

Group Policy Overview

LOCALMANAGEDAPPLICATION