当前位置: 首页>>代码示例>>C#>>正文


C# IShellLinkW类代码示例

本文整理汇总了C#中IShellLinkW的典型用法代码示例。如果您正苦于以下问题:C# IShellLinkW类的具体用法?C# IShellLinkW怎么用?C# IShellLinkW使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IShellLinkW类属于命名空间,在下文中一共展示了IShellLinkW类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

 public void Create (string file_path, string target_path)
 {
     link = (IShellLinkW) new CShellLink ();
     this.link.SetShowCmd (1);        
     this.link.SetPath (target_path);
     (this.link as IPersistFile).Save (file_path, true);
 }
开发者ID:Rud5G,项目名称:SparkleShare,代码行数:7,代码来源:SparkleShortcut.cs

示例2: ShellLink

 /// <summary>
 /// Creates an instance of the Shell Link object.
 /// </summary>
 public ShellLink()
 {
     if (System.Environment.OSVersion.Platform == PlatformID.Win32NT) {
         linkW = (IShellLinkW)new CShellLink();
     } else {
         linkA = (IShellLinkA)new CShellLink();
     }
 }
开发者ID:GoldRenard,项目名称:EFIReboot,代码行数:11,代码来源:ShellLink.cs

示例3: ShellShortcut

        ///
        /// <param name='linkPath'>
        ///   Path to new or existing shortcut file (.lnk).
        /// </param>
        ///
        public ShellShortcut(string linkPath)
        {
            IPersistFile pf;

            m_sPath = linkPath;
            m_Link = (IShellLinkW) new ShellLink();

            if (File.Exists(linkPath)) {
                pf = (IPersistFile) m_Link;
                pf.Load(linkPath, 0);
            }
        }
开发者ID:akx,项目名称:lauo,代码行数:17,代码来源:ShellShortcut.cs

示例4: ShellLink

 public ShellLink(string lnkPath)
 {
     this.lnkPath = lnkPath;
     if (Unicode)
     {
         _slW = (IShellLinkW)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID_ShellLink)));
         ((IPersistFile)(_slW)).Load(lnkPath, 0);
     }
     else
     {
         _slA = (IShellLinkA)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(CLSID_ShellLink)));
         ((IPersistFile)(_slA)).Load(lnkPath, 0);
     }
 }
开发者ID:wyrover,项目名称:SuperCMD,代码行数:14,代码来源:ShellLink.cs

示例5: ShellLink

        /// <summary>
        /// Constructor with creating shell link object and loading shortcut file
        /// </summary>
        /// <param name="shortcutPath">Shortcut file path</param>
        public ShellLink(string shortcutPath)
        {
            try
            {
                shellLink = (IShellLinkW)new CShellLink();
            }
            catch (Exception ex)
            {
                throw new COMException("Failed to create Shell link object.", ex);
            }

            if (shortcutPath != null) // To avoid default constructor
                this.Load(shortcutPath);
        }
开发者ID:MrSwiss,项目名称:DesktopToast,代码行数:18,代码来源:ShellLink.cs

示例6: _SHAddToRecentDocs_ShellLink

 private static extern void _SHAddToRecentDocs_ShellLink(SHARD uFlags, IShellLinkW pv);
开发者ID:AlertProject,项目名称:Text-processing-bundle,代码行数:1,代码来源:NativeMethods.cs

示例7: SHAddToRecentDocs

 internal static void SHAddToRecentDocs(IShellLinkW shellLink)
 {
     SHAddToRecentDocs_ShellLink(SHARD.LINK, shellLink);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:4,代码来源:ShellProvider.cs

示例8: ShellLinkToString

        /// <summary>
        /// Generate a unique string for the ShellLink that can be used for equality checks.
        /// </summary>
        private static string ShellLinkToString(IShellLinkW shellLink)
        {
            var pathBuilder = new StringBuilder((int)Win32Value.MAX_PATH);
            shellLink.GetPath(pathBuilder, pathBuilder.Capacity, null, SLGP.RAWPATH);

            string title = null;
            // Need to use the property store to get the title for the link.
            using (PROPVARIANT pv = new PROPVARIANT())
            {
                var propStore = (IPropertyStore)shellLink;
                PKEY pkeyTitle = PKEY.Title;

                propStore.GetValue(ref pkeyTitle, pv);

                // PKEY_Title should be an LPWSTR if it's not empty.
                title = pv.GetValue() ?? "";
            }

            var argsBuilder = new StringBuilder((int)Win32Value.INFOTIPSIZE);
            shellLink.GetArguments(argsBuilder, argsBuilder.Capacity);

            // Path and title should be case insensitive.
            // Shell treats arguments as case sensitive because apps can handle those differently.
            return pathBuilder.ToString().ToUpperInvariant() + title.ToUpperInvariant() + argsBuilder.ToString();
        }
开发者ID:Slashka-DK,项目名称:BlitzChat,代码行数:28,代码来源:JumpList.cs

示例9: ShellLink

        public ShellLink(string linkFile)
        {
            try
            {
                if (Environment.OSVersion.Platform == PlatformID.Win32NT)
                {
                    shellLinkW = (IShellLinkW)new ShellLinkObject();
                    shellLinkA = null;
                }
                else
                {
                    shellLinkA = (IShellLinkA)new ShellLinkObject();
                    shellLinkW = null;
                }
            }
            catch
            {
                throw new COMException("cannot create ShellLinkObject");
            }

            if (linkFile != null)
                Load(linkFile);
        }
开发者ID:karno,项目名称:Typict,代码行数:23,代码来源:ShellLink.cs

示例10: KfSymlink

        public KfSymlink(LinkType shortcutlinkType)
        {
            dataBuffer = new StringBuilder(260);

            // Get a pointer to the IShellLink interface.
            switch (shortcutlinkType)
            {
                case LinkType.File:
                    psl = (IShellLinkW) Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(ClsidShellLink)), true);
                    break;
                case LinkType.Folder:
                    psl = (IShellLinkW) Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid(ClsidFolderShortcut)), true);
                    break;
            }
        }
开发者ID:koffeinfrei,项目名称:base-dotnet,代码行数:15,代码来源:KfSymlink.cs

示例11: ShellLinkUtility

        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <exception cref="COMException">IShellLinkインターフェイスを取得できませんでした。</exception>
        public ShellLinkUtility()
        {
            currentFile = "";

            shellLinkW = null;
            shellLinkA = null;

            try
            {
                if (Environment.OSVersion.Platform == PlatformID.Win32NT)
                {
                    // Unicode環境
                    shellLinkW = (IShellLinkW)(new ShellLinkObject());

                    isUnicodeEnvironment = true;
                }
                else
                {
                    // Ansi環境
                    shellLinkA = (IShellLinkA)(new ShellLinkObject());

                    isUnicodeEnvironment = false;
                }
            }
            catch
            {
                throw new COMException("IShellLinkインターフェイスを取得できませんでした。");
            }
        }
开发者ID:Koichi-Kobayashi,项目名称:AipoReminder,代码行数:33,代码来源:ShellLinkUtility.cs

示例12: ShellLink

 public ShellLink() {
     if (Environment.OSVersion.Platform == PlatformID.Win32NT)
         linkW = (IShellLinkW) new CShellLink();
     else
         linkA = (IShellLinkA) new CShellLink();
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:6,代码来源:ShellLink.cs

示例13: SHAddToRecentDocs

 public static extern void SHAddToRecentDocs(SHARD uFlags, IShellLinkW pv);
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:1,代码来源:Shell32.cs

示例14: Dispose

 public void Dispose () {
     if (this.link == null )
         return;
     
     Marshal.ReleaseComObject (this.link);
     this.link = null;
 }
开发者ID:Rud5G,项目名称:SparkleShare,代码行数:7,代码来源:SparkleShortcut.cs

示例15: Dispose

 //
 //  IDisplosable implementation
 //
 public void Dispose()
 {
     if (m_Link != null)
     {
         Marshal.ReleaseComObject(m_Link);
         m_Link = null;
     }
 }
开发者ID:shunpei-suzuki,项目名称:wyupdate,代码行数:11,代码来源:ShellShortcut.cs


注:本文中的IShellLinkW类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。