Summary description for ShellLink.
| 11 | /// Summary description for ShellLink. |
| 12 | /// </summary> |
| 13 | public class ShellLink : IDisposable |
| 14 | { |
| 15 | [ComImport()] |
| 16 | [Guid("0000010C-0000-0000-C000-000000000046")] |
| 17 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] |
| 18 | interface IPersist |
| 19 | { |
| 20 | [PreserveSig] |
| 21 | //[helpstring("Returns the class identifier for the component object")] |
| 22 | void GetClassID(out Guid pClassID); |
| 23 | } |
| 24 | |
| 25 | [ComImport()] |
| 26 | [Guid("0000010B-0000-0000-C000-000000000046")] |
| 27 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] |
| 28 | interface IPersistFile |
| 29 | { |
| 30 | // can't get this to go if I extend IPersist, so put it here: |
| 31 | [PreserveSig] |
| 32 | void GetClassID(out Guid pClassID); |
| 33 | |
| 34 | //[helpstring("Checks for changes since last file write")] |
| 35 | void IsDirty(); |
| 36 | |
| 37 | //[helpstring("Opens the specified file and initializes the object from its contents")] |
| 38 | void Load( |
| 39 | [MarshalAs(UnmanagedType.LPWStr)] string pszFileName, |
| 40 | uint dwMode); |
| 41 | |
| 42 | //[helpstring("Saves the object into the specified file")] |
| 43 | void Save( |
| 44 | [MarshalAs(UnmanagedType.LPWStr)] string pszFileName, |
| 45 | [MarshalAs(UnmanagedType.Bool)] bool fRemember); |
| 46 | |
| 47 | //[helpstring("Notifies the object that save is completed")] |
| 48 | void SaveCompleted( |
| 49 | [MarshalAs(UnmanagedType.LPWStr)] string pszFileName); |
| 50 | |
| 51 | //[helpstring("Gets the current name of the file associated with the object")] |
| 52 | void GetCurFile( |
| 53 | [MarshalAs(UnmanagedType.LPWStr)] out string ppszFileName); |
| 54 | } |
| 55 | |
| 56 | [StructLayout(LayoutKind.Sequential)] |
| 57 | public struct PropVariant |
| 58 | { |
| 59 | public short variantType; |
| 60 | public short Reserved1, Reserved2, Reserved3; |
| 61 | public IntPtr pointerValue; |
| 62 | |
| 63 | public static PropVariant FromString(string str) |
| 64 | { |
| 65 | var pv = new PropVariant() { |
| 66 | variantType = 31, // VT_LPWSTR |
| 67 | pointerValue = Marshal.StringToCoTaskMemUni(str), |
| 68 | }; |
| 69 | |
| 70 | return pv; |
nothing calls this directly
no test coverage detected