浏览代码

优化部分代码,添加"共享到Skype"

蓝点lilac 5 年之前
父节点
当前提交
5f8929ea64
共有 33 个文件被更改,包括 226 次插入80 次删除
  1. 2 0
      ContextMenuManager/AppString.cs
  2. 3 0
      ContextMenuManager/ContextMenuManager.csproj
  3. 1 0
      ContextMenuManager/Controls/GuidBlockedItem.cs
  4. 1 1
      ContextMenuManager/Controls/Interfaces/IBtnDeleteItem.cs
  5. 1 1
      ContextMenuManager/Controls/Interfaces/IBtnMoveUpDownItem.cs
  6. 1 1
      ContextMenuManager/Controls/Interfaces/IBtnOpenPathItem.cs
  7. 1 1
      ContextMenuManager/Controls/Interfaces/IBtnShowMenuItem.cs
  8. 1 1
      ContextMenuManager/Controls/Interfaces/IChkVisibleItem.cs
  9. 1 1
      ContextMenuManager/Controls/Interfaces/IFoldGroupItem.cs
  10. 1 1
      ContextMenuManager/Controls/Interfaces/ITsiCommandItem.cs
  11. 1 1
      ContextMenuManager/Controls/Interfaces/ITsiDeleteItem.cs
  12. 1 1
      ContextMenuManager/Controls/Interfaces/ITsiFilePathItem.cs
  13. 1 1
      ContextMenuManager/Controls/Interfaces/ITsiIconItem.cs
  14. 1 1
      ContextMenuManager/Controls/Interfaces/ITsiRegPathItem.cs
  15. 1 1
      ContextMenuManager/Controls/Interfaces/ITsiTextItem.cs
  16. 1 1
      ContextMenuManager/Controls/Interfaces/ITsiWebSearchItem.cs
  17. 1 0
      ContextMenuManager/Controls/OpenWithItem.cs
  18. 1 0
      ContextMenuManager/Controls/RegRuleItem.cs
  19. 1 0
      ContextMenuManager/Controls/SendToItem.cs
  20. 1 0
      ContextMenuManager/Controls/ShellExItem.cs
  21. 1 0
      ContextMenuManager/Controls/ShellItem.cs
  22. 21 19
      ContextMenuManager/Controls/ShellList.cs
  23. 1 0
      ContextMenuManager/Controls/ShellNewItem.cs
  24. 1 0
      ContextMenuManager/Controls/ShellSubMenuDialog.cs
  25. 112 0
      ContextMenuManager/Controls/SpecialItems/SkypeShareItem.cs
  26. 1 0
      ContextMenuManager/Controls/ThirdRulesList.cs
  27. 1 0
      ContextMenuManager/Controls/WinXItem.cs
  28. 1 0
      ContextMenuManager/Controls/WinXList.cs
  29. 44 46
      ContextMenuManager/MainForm.cs
  30. 3 1
      ContextMenuManager/Program.cs
  31. 2 0
      ContextMenuManager/Properties/Resources/Texts/AppLanguageDic.ini
  32. 13 1
      ContextMenuManager/Properties/Resources/Texts/GuidInfosDic.ini
  33. 2 0
      languages/zh-CN.ini

+ 2 - 0
ContextMenuManager/AppString.cs

@@ -53,6 +53,7 @@ namespace ContextMenuManager
             public static string OpenWith => GetValue("OpenWith");
             public static string WinX => GetValue("WinX");
             public static string LnkFile => GetValue("LnkFile");
+            public static string UwpLnk => GetValue("UwpLnk");
             public static string ExeFile => GetValue("ExeFile");
             public static string TextFile => GetValue("TextFile");
             public static string ImageFile => GetValue("ImageFile");
@@ -90,6 +91,7 @@ namespace ContextMenuManager
             public static string OpenWith => GetValue("OpenWith");
             public static string WinX => GetValue("WinX");
             public static string LnkFile => GetValue("LnkFile");
+            public static string UwpLnk => GetValue("UwpLnk");
             public static string ExeFile => GetValue("ExeFile");
             public static string TextFile => GetValue("TextFile");
             public static string ImageFile => GetValue("ImageFile");

+ 3 - 0
ContextMenuManager/ContextMenuManager.csproj

@@ -132,6 +132,9 @@
     <Compile Include="Controls\Interfaces\IBtnMoveUpDownItem.cs">
       <SubType>Component</SubType>
     </Compile>
+    <Compile Include="Controls\SpecialItems\SkypeShareItem.cs">
+      <SubType>Component</SubType>
+    </Compile>
     <Compile Include="Controls\SubMenuModeForm.cs">
       <SubType>Form</SubType>
     </Compile>

+ 1 - 0
ContextMenuManager/Controls/GuidBlockedItem.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using System;
 using System.Windows.Forms;
 

+ 1 - 1
ContextMenuManager/Controls/Interfaces/IBtnDeleteItem.cs

@@ -2,7 +2,7 @@
 using BulePointLilac.Methods;
 using System.Windows.Forms;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface IBtnDeleteItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/IBtnMoveUpDownItem.cs

@@ -1,6 +1,6 @@
 using BulePointLilac.Controls;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface IBtnMoveUpDownItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/IBtnOpenPathItem.cs

@@ -1,7 +1,7 @@
 using BulePointLilac.Controls;
 using static BulePointLilac.Methods.ObjectPath;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface IBtnOpenPathItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/IBtnShowMenuItem.cs

@@ -1,7 +1,7 @@
 using BulePointLilac.Controls;
 using System.Windows.Forms;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface IBtnShowMenuItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/IChkVisibleItem.cs

@@ -1,7 +1,7 @@
 using BulePointLilac.Controls;
 using System.Windows.Forms;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface IChkVisibleItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/IFoldGroupItem.cs

@@ -3,7 +3,7 @@ using System.Drawing;
 using System.Windows.Forms;
 using static BulePointLilac.Methods.ObjectPath;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface IFoldGroupItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/ITsiCommandItem.cs

@@ -2,7 +2,7 @@
 using BulePointLilac.Methods;
 using System.Windows.Forms;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface ITsiCommandItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/ITsiDeleteItem.cs

@@ -1,7 +1,7 @@
 using BulePointLilac.Methods;
 using System.Windows.Forms;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface ITsiDeleteItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/ITsiFilePathItem.cs

@@ -3,7 +3,7 @@ using System.IO;
 using System.Windows.Forms;
 using static BulePointLilac.Methods.ObjectPath;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface ITsiFilePathItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/ITsiIconItem.cs

@@ -3,7 +3,7 @@ using BulePointLilac.Methods;
 using System.Drawing;
 using System.Windows.Forms;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface ITsiIconItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/ITsiRegPathItem.cs

@@ -2,7 +2,7 @@
 using System.Windows.Forms;
 using static BulePointLilac.Methods.ObjectPath;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface ITsiRegPathItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/ITsiTextItem.cs

@@ -2,7 +2,7 @@
 using BulePointLilac.Methods;
 using System.Windows.Forms;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface ITsiTextItem
     {

+ 1 - 1
ContextMenuManager/Controls/Interfaces/ITsiWebSearchItem.cs

@@ -1,7 +1,7 @@
 using System.Diagnostics;
 using System.Windows.Forms;
 
-namespace ContextMenuManager.Controls
+namespace ContextMenuManager.Controls.Interfaces
 {
     interface ITsiWebSearchItem
     {

+ 1 - 0
ContextMenuManager/Controls/OpenWithItem.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using Microsoft.Win32;
 using System;
 using System.Diagnostics;

+ 1 - 0
ContextMenuManager/Controls/RegRuleItem.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using Microsoft.Win32;
 using System.Drawing;
 using System.Windows.Forms;

+ 1 - 0
ContextMenuManager/Controls/SendToItem.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using Microsoft.Win32;
 using System.Drawing;
 using System.IO;

+ 1 - 0
ContextMenuManager/Controls/ShellExItem.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using Microsoft.Win32;
 using System;
 using System.Collections.Generic;

+ 1 - 0
ContextMenuManager/Controls/ShellItem.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using Microsoft.Win32;
 using System;
 using System.Collections.Generic;

+ 21 - 19
ContextMenuManager/Controls/ShellList.cs

@@ -25,6 +25,7 @@ namespace ContextMenuManager.Controls
         public const string MENUPATH_EXEFILE = @"HKEY_CLASSES_ROOT\exefile";//可执行文件
         public const string MENUPATH_SYSLNKFILE = @"HKEY_CLASSES_ROOT\SystemFileAssociations\.lnk";
         public const string MENUPATH_SYSEXEFILE = @"HKEY_CLASSES_ROOT\SystemFileAssociations\.exe";
+        public const string MENUPATH_UWPLNK = @"HKEY_CLASSES_ROOT\Launcher.ImmersiveApplication";
         public const string MENUPATH_UNKNOWN = @"HKEY_CLASSES_ROOT\Unknown";//未知格式
         public const string MENUPATH_TEXT = @"HKEY_CLASSES_ROOT\SystemFileAssociations\text";//通用文本文件
         public const string MENUPATH_IMAGE = @"HKEY_CLASSES_ROOT\SystemFileAssociations\image";//通用图像文件
@@ -32,25 +33,21 @@ namespace ContextMenuManager.Controls
         public const string MENUPATH_AUDIO = @"HKEY_CLASSES_ROOT\SystemFileAssociations\audio";//通用音频文件
         public const string MENUPATH_DIRECTORY_IMAGE = @"HKEY_CLASSES_ROOT\SystemFileAssociations\Directory.Image";//通用图像文件目录
         public const string MENUPATH_DIRECTORY_VIDEO = @"HKEY_CLASSES_ROOT\SystemFileAssociations\Directory.Video";//通用视频文件目录
-        public const string MENUPATH_DIRECTORY_AUDIO = @"HKEY_CLASSES_ROOT\SystemFileAssociations\Directory.Video";//通用音频文件目录
+        public const string MENUPATH_DIRECTORY_AUDIO = @"HKEY_CLASSES_ROOT\SystemFileAssociations\Directory.Audio";//通用音频文件目录
         public const string SYSFILEASSPATH = @"HKEY_CLASSES_ROOT\SystemFileAssociations";//系统扩展名注册表父项路径
 
         public enum Scenes
         {
-            File, Folder, Directory, Background, Desktop, Drive, AllObjects,
-            Computer, RecycleBin, Library, LnkFile, ExeFile, Text, Image, Video, Audio,
-            ImageDirectory, VideoDirectory, AudioDirectory, Unknown, CustomExtension
+            File, Folder, Directory, Background, Desktop, Drive, AllObjects, Computer, RecycleBin,
+            Library, LnkFile, UwpLnk, ExeFile, TextFile, ImageFile, VideoFile, AudioFile,
+            ImageDirectory, VideoDirectory, AudioDirectory, UnknownType, CustomType
         }
 
         private Scenes scene;
         public Scenes Scene
         {
             get => scene;
-            set
-            {
-                scene = value;
-                LoadItems();
-            }
+            set { scene = value; LoadItems(); }
         }
 
         private static string GetShellPath(string scenePath) => $@"{scenePath}\shell";
@@ -58,7 +55,7 @@ namespace ContextMenuManager.Controls
 
         public ShellList()
         {
-            TypeItem.ExtensionChanged += (sender, e) => this.Scene = Scenes.CustomExtension;
+            TypeItem.ExtensionChanged += (sender, e) => this.Scene = Scenes.CustomType;
         }
 
         private void LoadItems()
@@ -89,15 +86,17 @@ namespace ContextMenuManager.Controls
                     scenePath = MENUPATH_LIBRARY; break;
                 case Scenes.LnkFile:
                     scenePath = MENUPATH_LNKFILE; break;
+                case Scenes.UwpLnk:
+                    scenePath = MENUPATH_UWPLNK; break;
                 case Scenes.ExeFile:
                     scenePath = MENUPATH_EXEFILE; break;
-                case Scenes.Text:
+                case Scenes.TextFile:
                     scenePath = MENUPATH_TEXT; break;
-                case Scenes.Image:
+                case Scenes.ImageFile:
                     scenePath = MENUPATH_IMAGE; break;
-                case Scenes.Video:
+                case Scenes.VideoFile:
                     scenePath = MENUPATH_VIDEO; break;
-                case Scenes.Audio:
+                case Scenes.AudioFile:
                     scenePath = MENUPATH_AUDIO; break;
                 case Scenes.ImageDirectory:
                     scenePath = MENUPATH_DIRECTORY_IMAGE; break;
@@ -105,9 +104,9 @@ namespace ContextMenuManager.Controls
                     scenePath = MENUPATH_DIRECTORY_VIDEO; break;
                 case Scenes.AudioDirectory:
                     scenePath = MENUPATH_DIRECTORY_AUDIO; break;
-                case Scenes.Unknown:
+                case Scenes.UnknownType:
                     scenePath = MENUPATH_UNKNOWN; break;
-                case Scenes.CustomExtension:
+                case Scenes.CustomType:
                     scenePath = TypeItem.SysAssExtPath; break;
             }
             this.AddNewItem(scenePath);
@@ -115,6 +114,9 @@ namespace ContextMenuManager.Controls
 
             switch(scene)
             {
+                case Scenes.File:
+                    this.AddItem(new SpecialItems.SkypeShareItem());
+                    break;
                 case Scenes.Background:
                     this.AddItem(new RegRuleItem(RegRuleItem.CustomFolder) { MarginRight = RegRuleItem.SysMarginRignt });
                     break;
@@ -134,7 +136,7 @@ namespace ContextMenuManager.Controls
                 case Scenes.ExeFile:
                     this.AddItems(MENUPATH_SYSEXEFILE);
                     break;
-                case Scenes.CustomExtension:
+                case Scenes.CustomType:
                     this.InsertItem(new TypeItem(), 0);
                     this.AddItems(TypeItem.AssExtPath);
                     break;
@@ -143,7 +145,7 @@ namespace ContextMenuManager.Controls
 
         private void AddItems(string scenePath)
         {
-            if(this.Scene == Scenes.CustomExtension && TypeItem.Extension == null) return;
+            if(this.Scene == Scenes.CustomType && TypeItem.Extension == null) return;
             this.AddShellItems(GetShellPath(scenePath));
             this.AddShellExItems(GetShellExPath(scenePath));
         }
@@ -189,7 +191,7 @@ namespace ContextMenuManager.Controls
             AddCommonButton btnAddCommon = new AddCommonButton();
             newItem.AddCtr(btnAddCommon);
             this.AddItem(newItem);
-            if(this.Scene == Scenes.CustomExtension)
+            if(this.Scene == Scenes.CustomType)
             {
                 newItem.Visible = TypeItem.Extension != null;
                 TypeItem.ExtensionChanged += (sender, e) => newItem.Visible = TypeItem.Extension != null;

+ 1 - 0
ContextMenuManager/Controls/ShellNewItem.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using Microsoft.Win32;
 using System;
 using System.Drawing;

+ 1 - 0
ContextMenuManager/Controls/ShellSubMenuDialog.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using System;
 using System.Collections.Generic;
 using System.Drawing;

+ 112 - 0
ContextMenuManager/Controls/SpecialItems/SkypeShareItem.cs

@@ -0,0 +1,112 @@
+using BulePointLilac.Controls;
+using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
+using Microsoft.Win32;
+using System;
+using System.Drawing;
+using System.IO;
+using System.Windows.Forms;
+
+namespace ContextMenuManager.Controls.SpecialItems
+{
+    //所有文件的右键菜单项目:共享到Skype
+    //目前仅发现这一个特殊例子,不符合所有通用规则
+    sealed class SkypeShareItem : MyListItem, IChkVisibleItem, ITsiFilePathItem, ITsiRegPathItem, ITsiWebSearchItem, IBtnShowMenuItem
+    {
+        const string DllPath = @"Skype\SkypeContext.dll";
+        const string GuidName = "{776DBC8D-7347-478C-8D71-791E12EF49D8}";
+        const string PackageRegPath = @"HKEY_CLASSES_ROOT\PackagedCom\Package";
+        const string AppxRegPath = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx";
+
+        public SkypeShareItem()
+        {
+            InitializeComponents();
+            string path = ItemFilePath;
+            if(File.Exists(path))
+            {
+                ChkVisible.Checked = this.ItemVisible;
+                this.Text = ResourceString.GetDirectString($"@{path},-101");
+                string exePath = $@"{Path.GetDirectoryName(path)}\Skype.exe";
+                this.Image = Icon.ExtractAssociatedIcon(exePath)?.ToBitmap();
+            }
+            else this.Visible = false;
+        }
+
+        public string ItemFilePath
+        {
+            get
+            {
+                string AppxDirPath = Registry.GetValue(AppxRegPath, "PackageRoot", null)?.ToString();
+                if(!Directory.Exists(AppxDirPath)) return null;
+                foreach(DirectoryInfo di in new DirectoryInfo(AppxDirPath).GetDirectories())
+                {
+                    if(di.Name.StartsWith("Microsoft.SkypeApp", StringComparison.OrdinalIgnoreCase))
+                    {
+                        string value = $@"{di.FullName}\{DllPath}";
+                        if(File.Exists(value)) return value;
+                    }
+                }
+                return null;
+            }
+        }
+
+        private string PackageName
+        {
+            get
+            {
+                if(!File.Exists(ItemFilePath)) return null;
+                string[] strs = ItemFilePath.Split('\\');
+                return strs[strs.Length - 3];
+            }
+        }
+
+        public string RegPath
+        {
+            get
+            {
+                if(PackageName == null) return null;
+                return $@"{PackageRegPath}\{PackageName}\Class\{GuidName}";
+            }
+            set { }
+        }
+
+        public bool ItemVisible
+        {
+            get
+            {
+                using(RegistryKey key = RegistryEx.GetRegistryKey(RegPath))
+                {
+                    if(key == null) return true;
+                    string value = key.GetValue("DllPath")?.ToString();
+                    return value.Equals(DllPath, StringComparison.OrdinalIgnoreCase);
+                }
+            }
+            set
+            {
+                Registry.SetValue(RegPath, "DllPath", value ? DllPath : string.Empty);
+            }
+        }
+
+        public string SearchText => Text;
+
+        public MenuButton BtnShowMenu { get; set; }
+        public VisibleCheckBox ChkVisible { get; set; }
+        public WebSearchMenuItem TsiSearch { get; set; }
+        public RegLocationMenuItem TsiRegLocation { get; set; }
+        public FileLocationMenuItem TsiFileLocation { get; set; }
+        public FilePropertiesMenuItem TsiFileProperties { get; set; }
+
+        private void InitializeComponents()
+        {
+            BtnShowMenu = new MenuButton(this);
+            ChkVisible = new VisibleCheckBox(this);
+            TsiSearch = new WebSearchMenuItem(this);
+            TsiFileLocation = new FileLocationMenuItem(this);
+            TsiFileProperties = new FilePropertiesMenuItem(this);
+            TsiRegLocation = new RegLocationMenuItem(this);
+
+            ContextMenuStrip.Items.AddRange(new ToolStripItem[] { TsiSearch,
+                new ToolStripSeparator(), TsiFileProperties, TsiFileLocation, TsiRegLocation });
+        }
+    }
+}

+ 1 - 0
ContextMenuManager/Controls/ThirdRulesList.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using Microsoft.Win32;
 using System;
 using System.IO;

+ 1 - 0
ContextMenuManager/Controls/WinXItem.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using System.Drawing;
 using System.IO;
 using System.Windows.Forms;

+ 1 - 0
ContextMenuManager/Controls/WinXList.cs

@@ -1,5 +1,6 @@
 using BulePointLilac.Controls;
 using BulePointLilac.Methods;
+using ContextMenuManager.Controls.Interfaces;
 using System;
 using System.Collections.Generic;
 using System.IO;

+ 44 - 46
ContextMenuManager/MainForm.cs

@@ -79,6 +79,7 @@ namespace ContextMenuManager
 
         static readonly string[] TypeItems = {
             AppString.SideBar.LnkFile,
+            AppString.SideBar.UwpLnk,
             AppString.SideBar.ExeFile,
             null,
             AppString.SideBar.TextFile,
@@ -96,6 +97,7 @@ namespace ContextMenuManager
         };
         static readonly string[] TypeItemInfos = {
             AppString.StatusBar.LnkFile,
+            AppString.StatusBar.UwpLnk,
             AppString.StatusBar.ExeFile,
             null,
             AppString.StatusBar.TextFile,
@@ -128,6 +130,40 @@ namespace ContextMenuManager
             AppString.SideBar.Donate
         };
 
+        static readonly ShellList.Scenes[] GeneralShellScenes =
+        {
+            ShellList.Scenes.File,
+            ShellList.Scenes.Folder,
+            ShellList.Scenes.Directory,
+            ShellList.Scenes.Background,
+            ShellList.Scenes.Desktop,
+            ShellList.Scenes.Drive,
+            ShellList.Scenes.AllObjects,
+            ShellList.Scenes.Computer,
+            ShellList.Scenes.RecycleBin,
+            ShellList.Scenes.Library
+        };
+
+        static readonly ShellList.Scenes?[] TypeShellScenes =
+        {
+            ShellList.Scenes.LnkFile,
+            ShellList.Scenes.UwpLnk,
+            ShellList.Scenes.ExeFile,
+            null,
+            ShellList.Scenes.TextFile,
+            ShellList.Scenes.ImageFile,
+            ShellList.Scenes.VideoFile,
+            ShellList.Scenes.AudioFile,
+            null,
+            ShellList.Scenes.ImageDirectory,
+            ShellList.Scenes.VideoDirectory,
+            ShellList.Scenes.AudioDirectory,
+            null,
+            ShellList.Scenes.UnknownType,
+            null,
+            ShellList.Scenes.CustomType
+        };
+
         private void HideAllParts()
         {
             shellList.Visible = shellNewList.Visible = sendToList.Visible = openWithList.Visible
@@ -190,26 +226,6 @@ namespace ContextMenuManager
         {
             switch(SideBar.SelectIndex)
             {
-                case 0:
-                    shellList.Scene = ShellList.Scenes.File; break;
-                case 1:
-                    shellList.Scene = ShellList.Scenes.Folder; break;
-                case 2:
-                    shellList.Scene = ShellList.Scenes.Directory; break;
-                case 3:
-                    shellList.Scene = ShellList.Scenes.Background; break;
-                case 4:
-                    shellList.Scene = ShellList.Scenes.Desktop; break;
-                case 5:
-                    shellList.Scene = ShellList.Scenes.Drive; break;
-                case 6:
-                    shellList.Scene = ShellList.Scenes.AllObjects; break;
-                case 7:
-                    shellList.Scene = ShellList.Scenes.Computer; break;
-                case 8:
-                    shellList.Scene = ShellList.Scenes.RecycleBin; break;
-                case 9:
-                    shellList.Scene = ShellList.Scenes.Library; break;
                 case 11:
                     shellNewList.LoadItems(); shellNewList.Visible = true; break;
                 case 12:
@@ -218,37 +234,19 @@ namespace ContextMenuManager
                     openWithList.LoadItems(); openWithList.Visible = true; break;
                 case 15:
                     winXList.LoadItems(); winXList.Visible = true; break;
+                default:
+                    if(SideBar.SelectIndex <= 9)
+                    {
+                        shellList.Scene = GeneralShellScenes[SideBar.SelectIndex];
+                        shellList.Visible = true;
+                    }
+                    break;
             }
-            shellList.Visible = SideBar.SelectIndex <= 9;
         }
 
         private void SwitchTypeItem()
         {
-            switch(SideBar.SelectIndex)
-            {
-                case 0:
-                    shellList.Scene = ShellList.Scenes.LnkFile; break;
-                case 1:
-                    shellList.Scene = ShellList.Scenes.ExeFile; break;
-                case 3:
-                    shellList.Scene = ShellList.Scenes.Text; break;
-                case 4:
-                    shellList.Scene = ShellList.Scenes.Image; break;
-                case 5:
-                    shellList.Scene = ShellList.Scenes.Video; break;
-                case 6:
-                    shellList.Scene = ShellList.Scenes.Audio; break;
-                case 8:
-                    shellList.Scene = ShellList.Scenes.ImageDirectory; break;
-                case 9:
-                    shellList.Scene = ShellList.Scenes.VideoDirectory; break;
-                case 10:
-                    shellList.Scene = ShellList.Scenes.AudioDirectory; break;
-                case 12:
-                    shellList.Scene = ShellList.Scenes.Unknown; break;
-                case 14:
-                    shellList.Scene = ShellList.Scenes.CustomExtension; break;
-            }
+            shellList.Scene = (ShellList.Scenes)TypeShellScenes[SideBar.SelectIndex];
             shellList.Visible = true;
         }
 

+ 3 - 1
ContextMenuManager/Program.cs

@@ -33,9 +33,11 @@ namespace ContextMenuManager
                 DirectoryInfo di = new DirectoryInfo(LanguagesDir);
                 if(value.Equals(string.Empty) && di.Exists)
                 {
+                    string sysLanguageName = new CultureInfo(GetUserDefaultUILanguage()).Name;
                     foreach(FileInfo fi in di.GetFiles())
                     {
-                        if(Path.GetFileNameWithoutExtension(fi.Name).Equals(new CultureInfo(GetUserDefaultUILanguage()).Name, StringComparison.OrdinalIgnoreCase))
+                        string fileName = Path.GetFileNameWithoutExtension(fi.Name);
+                        if(fileName.Equals(sysLanguageName, StringComparison.OrdinalIgnoreCase))
                         {
                             value = fi.FullName; break;
                         }

+ 2 - 0
ContextMenuManager/Properties/Resources/Texts/AppLanguageDic.ini

@@ -31,6 +31,7 @@ OpenWith = 打开方式
 WinX = Win+X
 
 LnkFile = lnk文件
+UwpLnk = uwp lnk
 ExeFile = exe文件
 TextFile = 文本文件
 ImageFile = 图像文件
@@ -67,6 +68,7 @@ OpenWith = 所有文件右键 "打开方式" 的菜单项目
 WinX = Win10 "开始" 按钮的右键Win+X菜单项目
 
 LnkFile = 所有快捷方式的右键菜单
+UwpLnk = Win10 UWP应用快捷方式的右键菜单
 ExeFile = 所有EXE可执行文件的右键菜单
 TextFile = 通用文本格式(如.txt、.ini)文件的右键菜单
 ImageFile = 通用图像格式(如.jpg、.png)文件的右键菜单

+ 13 - 1
ContextMenuManager/Properties/Resources/Texts/GuidInfosDic.ini

@@ -255,4 +255,16 @@ Text=金山毒霸(32位)扫描 && 文件粉碎
 Icon=.\kismain.exe,0
 [8f556da3-987d-47b0-aa88-eb8d52fe1b9a]
 Text=迅雷播放组件
-Icon=..\Program\XMP\XMP.exe,0
+Icon=..\Program\XMP\XMP.exe,0
+[dde4beeb-dde6-48fd-8eb5-035c09923f83]
+Text=Unlocker
+Icon=.\Unlocker.exe,0
+[9c5397bb-07be-4e38-98ba-395f94045091]
+Text=福昕PDF编辑器
+Icon=..\FoxitPhantom.exe,0
+[eee949eb-c9ed-4967-98b0-ed4e543befa5]
+Text=115网盘
+Icon=..\115chrome.exe,0
+[C49499AC-DC25-478B-B903-E005012B3DD1]
+Text=使用智量扫描
+Icon=.\WiseVector.exe,0

+ 2 - 0
languages/zh-CN.ini

@@ -31,6 +31,7 @@ OpenWith = 打开方式
 WinX = Win+X
 
 LnkFile = lnk文件
+UwpLnk = uwp lnk
 ExeFile = exe文件
 TextFile = 文本文件
 ImageFile = 图像文件
@@ -67,6 +68,7 @@ OpenWith = 所有文件右键 "打开方式" 的菜单项目
 WinX = Win10 "开始" 按钮的右键Win+X菜单项目
 
 LnkFile = 所有快捷方式的右键菜单
+UwpLnk = Win10 UWP应用快捷方式的右键菜单
 ExeFile = 所有EXE可执行文件的右键菜单
 TextFile = 通用文本格式(如.txt、.ini)文件的右键菜单
 ImageFile = 通用图像格式(如.jpg、.png)文件的右键菜单