MsiGetShortcutTarget function
The MsiGetShortcutTarget function examines a shortcut and returns its product, feature name, and component if available.
Syntax
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
|
Version | 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. |
|---|---|
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | MsiGetShortcutTargetW (Unicode) and MsiGetShortcutTargetA (ANSI) |
Build date: 11/30/2012