Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Interfaces, prefix the name with the module name and a period.
pageIShellLinkA_doc (Interfaces)
.
C# Definition:
[ComImport]
[Guid("00021401-0000-0000-C000-000000000046")]
internal class ShellLink
{
[Guid("TODO")]
//TODO: Insert [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] if this doesn't derive from IDispatch
interface pageIShellLinkA_doc {
TODO;
}
<ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("000214F9-0000-0000-C000-000000000046")>
Private Interface IShellLink
Sub GetPath(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszFile As StringBuilder, ByVal cchMaxPath As Integer, <Out> ByRef pfd As IntPtr, ByVal fFlags As Integer)
Sub GetIDList(<Out> ByRef ppidl As IntPtr)
Sub SetIDList(ByVal pidl As IntPtr)
Sub GetDescription(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszName As StringBuilder, ByVal cchMaxName As Integer)
Sub SetDescription(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszName As String)
Sub GetWorkingDirectory(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszDir As StringBuilder, ByVal cchMaxPath As Integer)
Sub SetWorkingDirectory(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszDir As String)
Sub GetArguments(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszArgs As StringBuilder, ByVal cchMaxPath As Integer)
Sub SetArguments(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszArgs As String)
Sub GetHotkey(<Out> ByRef pwHotkey As Short)
Sub SetHotkey(ByVal wHotkey As Short)
Sub GetShowCmd(<Out> ByRef piShowCmd As Integer)
Sub SetShowCmd(ByVal iShowCmd As Integer)
Sub GetIconLocation(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszIconPath As StringBuilder, ByVal cchIconPath As Integer, <Out> ByRef piIcon As Integer)
Sub SetIconLocation(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszIconPath As String, ByVal iIcon As Integer)
Sub SetRelativePath(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszPathRel As String, ByVal dwReserved As Integer)
Sub Resolve(ByVal hwnd As IntPtr, ByVal fFlags As Integer)
Sub SetPath(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszFile As String)
End Interface
Private Interface IShellLink
Sub GetPath(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszFile As StringBuilder, ByVal cchMaxPath As Integer, <Out> ByRef pfd As IntPtr, ByVal fFlags As Integer)
Sub GetIDList(<Out> ByRef ppidl As IntPtr)
Sub SetIDList(ByVal pidl As IntPtr)
Sub GetDescription(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszName As StringBuilder, ByVal cchMaxName As Integer)
Sub SetDescription(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszName As String)
Sub GetWorkingDirectory(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszDir As StringBuilder, ByVal cchMaxPath As Integer)
Sub SetWorkingDirectory(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszDir As String)
Sub GetArguments(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszArgs As StringBuilder, ByVal cchMaxPath As Integer)
Sub SetArguments(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszArgs As String)
Sub GetHotkey(<Out> ByRef pwHotkey As Short)
Sub SetHotkey(ByVal wHotkey As Short)
Sub GetShowCmd(<Out> ByRef piShowCmd As Integer)
Sub SetShowCmd(ByVal iShowCmd As Integer)
Sub GetIconLocation(<Out, MarshalAs(UnmanagedType.LPWStr)> ByVal pszIconPath As StringBuilder, ByVal cchIconPath As Integer, <Out> ByRef piIcon As Integer)
Sub SetIconLocation(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszIconPath As String, ByVal iIcon As Integer)
Sub SetRelativePath(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszPathRel As String, ByVal dwReserved As Integer)
Sub Resolve(ByVal hwnd As IntPtr, ByVal fFlags As Integer)
Sub SetPath(<MarshalAs(UnmanagedType.LPWStr)> ByVal pszFile As String)
End Interface
User-Defined Types:
None.
How to use example (VB):
Public Shared Sub CreateNewShortcut(LNKLocation As String, LNKTarget As String, Optional TargetArgs As String = Nothing, Optional StartFolder As String = Nothing,
Optional Description As String = Nothing, Optional IconFile As String = "c:\windows\System32\SHELL32.dll", Optional IconIndex As Integer = 21)
Notes:
None.
Dim link As IShellLink = CType(New ShellLink(), IShellLink)
If Description <> Nothing Then link.SetDescription(Description)
If TargetArgs <> Nothing Then link.SetArguments(TargetArgs)
If IconFile <> Nothing Then link.SetIconLocation(IconFile, IconIndex)
link.SetPath(LNKTarget)
Dim file As System.Runtime.InteropServices.ComTypes.IPersistFile = CType(link, ComTypes.IPersistFile)
file.Save(LNKLocation, False)
link.SetPath("C:\windows\System32\calc.exe")
End Sub
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.