IShellLinkA::GetArguments method (shobjidl_core.h)

Gets the command-line arguments associated with a Shell link object.

Syntax

HRESULT GetArguments(
  [out] LPSTR pszArgs,
  [in]  int   cch
);

Parameters

[out] pszArgs

Type: LPTSTR

A pointer to the buffer that, when this method returns successfully, receives the command-line arguments.

[in] cch

Type: int

The maximum number of characters that can be copied to the buffer supplied by the pszArgs parameter. In the case of a Unicode string, there is no limitation on maximum string length. In the case of an ANSI string, the maximum length of the returned string varies depending on the version of Windows—MAX_PATH prior to Windows 2000 and INFOTIPSIZE (defined in Commctrl.h) in Windows 2000 and later.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

In Windows 7 and later, it is recommended that you retrieve argument strings though IPropertyStore (using the PKEY_Link_Arguments value) rather than this method, which can silently truncate the string if the provided buffer is not large enough. IPropertyStore allocates a string of the correct size.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shobjidl_core.h
DLL Shell32.dll (version 4.0 or later)

See also

IShellLink

IShellLink::SetArguments

IShellLinkA

IShellLinkW