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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("Shell32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function SHGetNewLinkInfo (
linkTo As String,
dir As String,
name As StringBuilder,
<OutAttribute> ByRef refMustCopy As Boolean,
flags As SHGetNewLinkInfoFlags
) As Boolean
Dim linkTo As String
Dim dir As String
Dim name As StringBuilder
Dim refMustCopy As Boolean
Dim flags As SHGetNewLinkInfoFlags
Dim returnValue As Boolean
returnValue = Shell32.SHGetNewLinkInfo(linkTo,
dir, name, refMustCopy, flags)
public:
[DllImportAttribute(L"Shell32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool SHGetNewLinkInfo(
[InAttribute] String^ linkTo,
[InAttribute] String^ dir,
StringBuilder^ name,
[OutAttribute] bool% refMustCopy,
SHGetNewLinkInfoFlags flags
)
[<DllImportAttribute("Shell32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member SHGetNewLinkInfo :
linkTo : string *
dir : string *
name : StringBuilder *
refMustCopy : bool byref *
flags : SHGetNewLinkInfoFlags -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
Returns
if successful;
otherwise,
.