MsiGetShortcutTarget Function

Windows Installer

MsiGetShortcutTarget Function

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

Syntax

C++UINT MsiGetShortcutTarget(
  __in   LPCTSTR szShortcutTarget,
  __out  LPTSTR szProductCode,
  __out  LPTSTR szFeatureId,
  __out  LPTSTR szComponentCode
);

Parameters

szShortcutTarget [in]

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

szProductCode [out]

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.

szFeatureId [out]

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

szComponentCode [out]

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

ERROR_SUCCESS

The function succeeded.

ERROR_FUNCTION_FAILED

The function failed.

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.

Requirements

VersionWindows Installer 5.0 on 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, Windows XP, and Windows 2000. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.
HeaderMsi.h
LibraryMsi.lib
DLLMsi.dll
Unicode and ANSI namesMsiGetShortcutTargetW (Unicode) and MsiGetShortcutTargetA (ANSI)

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.