MsiGetShortcutTargetA function (msi.h)

The MsiGetShortcutTarget function examines a shortcut and returns its product, feature name, and component if available.

Syntax

UINT MsiGetShortcutTargetA(
  [in]  LPCSTR szShortcutPath,
  [out] LPSTR  szProductCode,
  [out] LPSTR  szFeatureId,
  [out] LPSTR  szComponentCode
);

Parameters

[in] szShortcutPath

A null-terminated string specifying the full path to a shortcut.

[out] szProductCode

A GUID for the product code of the shortcut. This string buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating null character. This parameter can be null.

[out] szFeatureId

The feature name of the shortcut. The string buffer must be MAX_FEATURE_CHARS+1 characters long. This parameter can be null.

[out] szComponentCode

A GUID of the component code. This string buffer must be 39 characters long. The first 38 characters are for the GUID, and the last character is for the terminating null character. This parameter can be null.

Return value

This function returns UINT.

Remarks

If the function fails, and the shortcut exists, the regular contents of the shortcut may be accessed through the IShellLink interface.

Otherwise, the state of the target may be determined by using the Installer Selection Functions.

Note

The msi.h header defines MsiGetShortcutTarget as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.
Target Platform Windows
Header msi.h
Library Msi.lib
DLL Msi.dll