ShellLink 1.0
Downloads:
Publisher: Karl E. Peterson
File size: 22KB
OS: Windows XP, 2000, 98, Me
Date added: 2009-10-27
Homepage: http://vb.mvps.org/
Category: Development
ShellLink 1.0 Description
"Read and write shortcut files from managed code."
EditByBSEditor: This sample demonstrates how to read and write shortcut files from managed code. It includes definitions of the COM interfaces and coclasses needed. Included is also a more .NET friendly wrapper class, called ShellShortcut, that takes care of most of the dirty work. To demonstrate the usage of the ShellShortcut class, a simple shortcut editor form is included. To use shortcuts in your own code, simply include the files ShellLinkNative.cs and ShellShortcut.cs in your project.
Details
Shortcuts are created and modified using a COM API, where the ShellLink coclass is the most important part. It implements the IShellLink interface (which exists in two versions, IShellLinkA for ANSI and IShellLinkW for Unicode) used to manipulate the shortcut itself, and the IPersistFile interface for opening and saving shortcut files. (It also implements the IShellLinkDataList interface to store extra data with shortcuts, and a number of other interfaces we don't care about).
There are Two Ways to get access to this coclass and its related interfaces in managed code. The first is to Declare them all in a type library, then use the TlbImp tool to create a managed Assembly from it. The second way, used in this sample, is to declare all of it ourselves in code. The advantage of doing it this way is that you get one less assembly to care about. But it also means you have to understand the details about COM interop and marshaling.
The coclass and the interfaces are marked with the ComImport and Guid attributes. The interfaces also need the InterfaceType attribute. Then some of the methods and method parameters need attributes as well to ensure correct marshaling. The .NET interop documentation explains all this fairly well. you can free download ShellLink 1.0 now.
ShellLink 1.0 Keywords
ShellLink 1.0 Related Software
- CustomBlt
Provides TransBlt and TileBlt routines for transparent and tiled bitblts. - LongScroll
Provides support for Long (32-bit) values with standard scrollbars; - Dynamic PInvoke method calls
Gives you the ability to build and execute code at runtime. - EnumMsgs
Enumerates the list of strings Windows maintains for things like - Shell Namespaces
Create a namespace extension. - BcHelp
Can be used to quickly open the right help page in your browser - ShellLink
Read and write shortcut files from managed code. - ObjArrays
Create an array of objects that provide WithEvents functionality. - Assembly Cache Viewer
A tool window add-in for Visual Studio .NET - ListSearch
- VBBubble
Add multiline and text alignment support to your VB tooltips - EnumRes
Enumerates resources embedded within any file, and displays many standard types. - Command output
Capture the output of a console application into a VB String - ThemeMe
A utility for embedding a manifest resource in an executable file - MovedMsg
Position a MsgBox anywhere on screen, or directly over specified window. - COMRunDll
A simple wrapper that enables COM serversto be called from Rundll32.exe - DirDrill
Demonstrates recursive use of VB's Dir function. - Mainboard DMI Information Viewer
Report make and model of the motherboard as well as a wealth of information - OpSys
Determine what operating system your application is running under. - HookMe
Native subclassing technique for VB5/6. Extremely clean. - RegSettings
Replacement for VB's native registry functions.
ShellLink 1.0 Publisher's Software
Popular Searches
Hot Downloads Software
New Release Software