FormatApplicationUserModelId function (appmodel.h)

Constructs an application user model ID from the package family name and the package relative application ID (PRAID).

Syntax

LONG FormatApplicationUserModelId(
  PCWSTR packageFamilyName,
  PCWSTR packageRelativeApplicationId,
  UINT32 *applicationUserModelIdLength,
  PWSTR  applicationUserModelId
);

Parameters

packageFamilyName

Type: PCWSTR

The package family name.

packageRelativeApplicationId

Type: PCWSTR

The package-relative app ID (PRAID).

applicationUserModelIdLength

Type: UINT32*

A pointer to a variable that holds the number of characters (WCHARs) in the app user model ID string, which includes the null-terminator.

First you pass NULL to applicationUserModelId to get the number of characters. You use this number to allocate memory space for applicationUserModelId. Then you pass the address of this memory space to fill applicationUserModelId.

applicationUserModelId

Type: PWSTR

A pointer to memory space that receives the app user model ID string, which includes the null-terminator.

Return value

Type: LONG

If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes include the following.

Return code Description
ERROR_INVALID_PARAMETER
The packageFamilyName or packageRelativeApplicationId parameter isn't valid.
ERROR_INSUFFICIENT_BUFFER
The buffer specified by applicationUserModelId is not large enough to hold the data; the required buffer size, in WCHARs, is stored in the variable pointed to by applicationUserModelIdLength.

Requirements

   
Minimum supported client Windows 8.1 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 R2 [desktop apps | UWP apps]
Target Platform Windows
Header appmodel.h
Library Kernel32.lib
DLL Kernel32.dll