Shell32SHGetNewLinkInfo Method

Creates a name for a new shortcut based on the shortcut's proposed target. This function does not create the shortcut, just the name.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Shell32.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool SHGetNewLinkInfo(
	string linkTo,
	string dir,
	StringBuilder name,
	out bool refMustCopy,
	SHGetNewLinkInfoFlags flags
)

Parameters

linkTo  String
A pointer to the path and file name of the shortcut's target.

If flags does not contain the Pidl value, this parameter is the address of a null-terminated string that contains the target.

If flags contains the Pidl value, this parameter is a PIDL that represents the target.

dir  String
A pointer to a null-terminated string that contains the path of the folder in which the shortcut would be created.
name  StringBuilder
A pointer to a string that receives the null-terminated path and file name for the shortcut.

This buffer is assumed to be at least MAX_PATH characters in size.

refMustCopy  Boolean
A Boolean value that receives a flag indicating whether the shortcut would be copied.

When a shortcut to another shortcut is created, the Shell simply copies the target shortcut and modifies that copied shortcut appropriately.

This parameter receives a nonzero value if the target specified in linkTo specifies a shortcut that will cause the target shortcut to be copied.

This parameter receives zero if the target does not specify a shortcut that would be copied.

flags  SHGetNewLinkInfoFlags
The options for the function.

Return Value

Boolean
Returns if successful; otherwise, .

Remarks

See Also