mirror of
https://github.com/BluePointLilac/ContextMenuManager.git
synced 2026-01-14 06:04:00 +08:00
优化部分代码,添加UWP新菜单项目模块解析
This commit is contained in:
@@ -33,15 +33,18 @@ namespace ContextMenuManager
|
||||
public static string UserDicsDir = $@"{DicsDir}\User";
|
||||
public static string WebGuidInfosDic = $@"{WebDicsDir}\{GUIDINFOSDICINI}";
|
||||
public static string UserGuidInfosDic = $@"{UserDicsDir}\{GUIDINFOSDICINI}";
|
||||
public static string WebThirdRulesDic = $@"{WebDicsDir}\{ThIRDRULESDICXML}";
|
||||
public static string UserThirdRulesDic = $@"{UserDicsDir}\{ThIRDRULESDICXML}";
|
||||
public static string WebThirdRulesDic = $@"{WebDicsDir}\{THIRDRULESDICXML}";
|
||||
public static string UserThirdRulesDic = $@"{UserDicsDir}\{THIRDRULESDICXML}";
|
||||
public static string WebEnhanceMenusDic = $@"{WebDicsDir}\{ENHANCEMENUSICXML}";
|
||||
public static string UserEnhanceMenusDic = $@"{UserDicsDir}\{ENHANCEMENUSICXML}";
|
||||
public static string WebUwpModeItemsDic = $@"{UserDicsDir}\{UWPMODEITEMSDICXML}";
|
||||
public static string UserUwpModeItemsDic = $@"{UserDicsDir}\{UWPMODEITEMSDICXML}";
|
||||
public static string HashLnkExePath = $@"{ProgramsDir}\HashLnk.exe";
|
||||
public const string ZH_CNINI = "zh-CN.ini";
|
||||
public const string GUIDINFOSDICINI = "GuidInfosDic.ini";
|
||||
public const string ThIRDRULESDICXML = "ThirdRulesDic.xml";
|
||||
public const string THIRDRULESDICXML = "ThirdRulesDic.xml";
|
||||
public const string ENHANCEMENUSICXML = "EnhanceMenusDic.xml";
|
||||
public const string UWPMODEITEMSDICXML = "UwpModeItemsDic.xml";
|
||||
|
||||
public static readonly string[] EngineUrls =
|
||||
{
|
||||
|
||||
37
ContextMenuManager/AppDic.cs
Normal file
37
ContextMenuManager/AppDic.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using BluePointLilac.Methods;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
namespace ContextMenuManager
|
||||
{
|
||||
static class AppDic
|
||||
{
|
||||
public static XmlDocument ReadXml(string webDicPath, string userDicPath, string appDic)
|
||||
{
|
||||
XmlDocument doc1 = new XmlDocument();
|
||||
try
|
||||
{
|
||||
if(File.Exists(webDicPath))
|
||||
{
|
||||
doc1.LoadXml(File.ReadAllText(webDicPath, EncodingType.GetType(webDicPath)));
|
||||
}
|
||||
else
|
||||
{
|
||||
doc1.LoadXml(appDic);
|
||||
}
|
||||
if(File.Exists(userDicPath))
|
||||
{
|
||||
XmlDocument doc2 = new XmlDocument();
|
||||
doc2.LoadXml(File.ReadAllText(userDicPath, EncodingType.GetType(userDicPath)));
|
||||
foreach(XmlNode xn in doc2.DocumentElement.ChildNodes)
|
||||
{
|
||||
XmlNode node = doc1.ImportNode(xn, true);
|
||||
doc1.DocumentElement.AppendChild(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return doc1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,8 +49,6 @@ namespace ContextMenuManager
|
||||
public static readonly Image Select = Resources.Select.ResizeImage(Scale);
|
||||
///<summary>Microsoft Store图标</summary>
|
||||
public static readonly Image MicrosoftStore = Resources.MicrosoftStore.ResizeImage(Scale);
|
||||
///<summary>Skype图标</summary>
|
||||
public static readonly Image Skype = Resources.Skype.ResizeImage(Scale);
|
||||
///<summary>dll文件默认图标</summary>
|
||||
public static readonly Image DllDefaultIcon = ResourceIcon.GetExtensionIcon(".dll").ToBitmap();
|
||||
///<summary>资源不存在图标</summary>
|
||||
|
||||
@@ -166,7 +166,6 @@ namespace ContextMenuManager
|
||||
public static string RemovableDrive => GetValue("RemovableDrive");
|
||||
public static string BuildSendtoMenu => GetValue("BuildSendtoMenu");
|
||||
public static string UseStoreOpenWith => GetValue("UseStoreOpenWith");
|
||||
public static string ShareWithSkype => GetValue("ShareWithSkype");
|
||||
public static string NewItem => GetValue("NewItem");
|
||||
public static string AddGuidBlockedItem => GetValue("AddGuidBlockedItem");
|
||||
public static string SelectExtension => GetValue("SelectExtension");
|
||||
@@ -200,7 +199,6 @@ namespace ContextMenuManager
|
||||
public static string MultiMenu => GetValue("MultiMenu");
|
||||
public static string Public => GetValue("Public");
|
||||
public static string Private => GetValue("Private");
|
||||
public static string Administrator => GetValue("Administrator");
|
||||
public static string InputGuid => GetValue("InputGuid");
|
||||
public static string AddGuidDic => GetValue("AddGuidDic");
|
||||
public static string DeleteGuidDic => GetValue("DeleteGuidDic");
|
||||
@@ -218,6 +216,7 @@ namespace ContextMenuManager
|
||||
public static string CheckReference => GetValue("CheckReference");
|
||||
public static string CheckCopy => GetValue("CheckCopy");
|
||||
public static string SelectSubMenuMode => GetValue("SelectSubMenuMode");
|
||||
public static string SelectNewItemType => GetValue("SelectNewItemType");
|
||||
public static string RegistryFile => GetValue("RegistryFile");
|
||||
public static string SelectGroup => GetValue("SelectGroup");
|
||||
}
|
||||
@@ -263,13 +262,9 @@ namespace ContextMenuManager
|
||||
private static string GetValue(string key) => GetStringValue("Other", key);
|
||||
public static string RestartExplorer => GetValue("RestartExplorer");
|
||||
public static string DictionaryDescription => GetValue("DictionaryDescription");
|
||||
public static string LanguageDictionary => GetValue("LanguageDictionary");
|
||||
public static string GuidInfosDictionary => GetValue("GuidInfosDictionary");
|
||||
public static string ThridRulesDictionary => GetValue("ThridRulesDictionary");
|
||||
public static string CommonItemsDictionary => GetValue("CommonItemsDictionary");
|
||||
public static string Translators => GetValue("Translators");
|
||||
public static string OtherLanguages => GetValue("OtherLanguages");
|
||||
public static string SelectSubMenuMode => GetValue("SelectSubMenuMode");
|
||||
public static string AboutApp => GetValue("AboutApp");
|
||||
public static string Dictionaries => GetValue("Dictionaries");
|
||||
public static string Donate => GetValue("Donate");
|
||||
|
||||
@@ -12,29 +12,39 @@ namespace BluePointLilac.Methods
|
||||
{
|
||||
public static void JumpRegEdit(string regPath, string valueName = null, bool moreOpen = false)
|
||||
{
|
||||
Process process;
|
||||
IntPtr hMain = FindWindow("RegEdit_RegEdit", null);
|
||||
if(moreOpen || hMain == IntPtr.Zero)
|
||||
if(hMain != IntPtr.Zero && !moreOpen)
|
||||
{
|
||||
using(Process process = Process.Start("regedit.exe", "-m"))
|
||||
{
|
||||
process.WaitForInputIdle();
|
||||
hMain = process.MainWindowHandle;
|
||||
}
|
||||
GetWindowThreadProcessId(hMain, out int id);
|
||||
process = Process.GetProcessById(id);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
process = Process.Start("regedit.exe", "-m");
|
||||
process.WaitForInputIdle();
|
||||
hMain = process.MainWindowHandle;
|
||||
}
|
||||
|
||||
ShowWindowAsync(hMain, SW_SHOWNORMAL);
|
||||
SetForegroundWindow(hMain);
|
||||
IntPtr hTree = FindWindowEx(hMain, IntPtr.Zero, "SysTreeView32", null);
|
||||
IntPtr hList = FindWindowEx(hMain, IntPtr.Zero, "SysListView32", null);
|
||||
|
||||
SetForegroundWindow(hTree);
|
||||
SetFocus(hTree);
|
||||
process.WaitForInputIdle();
|
||||
SendMessage(hTree, WM_KEYDOWN, VK_HOME, null);
|
||||
Thread.Sleep(50);
|
||||
Thread.Sleep(100);
|
||||
process.WaitForInputIdle();
|
||||
SendMessage(hTree, WM_KEYDOWN, VK_RIGHT, null);
|
||||
foreach(char chr in Encoding.Default.GetBytes(regPath))
|
||||
{
|
||||
process.WaitForInputIdle();
|
||||
if(chr == '\\')
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
Thread.Sleep(100);
|
||||
SendMessage(hTree, WM_KEYDOWN, VK_RIGHT, null);
|
||||
}
|
||||
else
|
||||
@@ -48,14 +58,17 @@ namespace BluePointLilac.Methods
|
||||
{
|
||||
if(key?.GetValue(valueName) == null) return;
|
||||
}
|
||||
Thread.Sleep(50);
|
||||
Thread.Sleep(100);
|
||||
SetForegroundWindow(hList);
|
||||
SetFocus(hList);
|
||||
process.WaitForInputIdle();
|
||||
SendMessage(hList, WM_KEYDOWN, VK_HOME, null);
|
||||
foreach(char chr in Encoding.Default.GetBytes(valueName))
|
||||
{
|
||||
process.WaitForInputIdle();
|
||||
SendMessage(hList, WM_CHAR, Convert.ToInt16(chr), null);
|
||||
}
|
||||
process.Dispose();
|
||||
}
|
||||
|
||||
public static void JumpExplorer(string filePath)
|
||||
@@ -130,6 +143,7 @@ namespace BluePointLilac.Methods
|
||||
}
|
||||
}
|
||||
|
||||
private const int SW_SHOWNORMAL = 1;
|
||||
private const int SW_SHOW = 5;
|
||||
private const uint SEE_MASK_INVOKEIDLIST = 12;
|
||||
private const int WM_SETTEXT = 0xC;
|
||||
@@ -138,12 +152,18 @@ namespace BluePointLilac.Methods
|
||||
private const int VK_HOME = 0x24;
|
||||
private const int VK_RIGHT = 0x27;
|
||||
|
||||
[DllImport("User32.dll")]
|
||||
private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
|
||||
|
||||
[DllImport("User32.dll")]
|
||||
private static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||
|
||||
[DllImport("User32.dll")]
|
||||
private static extern bool SetFocus(IntPtr hWnd);
|
||||
|
||||
[DllImport("User32.dll", CharSet = CharSet.Auto)]
|
||||
public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr FindWindow(string lpszClass, string lpszWindow);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
@@ -110,6 +110,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppConfig.cs" />
|
||||
<Compile Include="AppDic.cs" />
|
||||
<Compile Include="BluePointLilac.Controls\MyToolTip.cs" />
|
||||
<Compile Include="BluePointLilac.Controls\ReadOnlyRichTextBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
@@ -155,6 +156,9 @@
|
||||
<Compile Include="Controls\Interfaces\ITsiAdministratorItem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\Interfaces\ITsiGuidItem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\Interfaces\ITsiShortcutCommandItem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -263,6 +267,9 @@
|
||||
<Compile Include="Controls\ThirdRulesList.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\UwpModeItem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\WinXGroupItem.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -331,6 +338,7 @@
|
||||
<None Include="Properties\App.manifest" />
|
||||
<None Include="Properties\Resources\Texts\AppLanguageDic.ini" />
|
||||
<None Include="Properties\Resources\Texts\GuidInfosDic.ini" />
|
||||
<Content Include="Properties\Resources\Texts\UwpModeItemsDic.xml" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
@@ -361,7 +369,6 @@
|
||||
<Content Include="Properties\Resources\Images\Custom.png" />
|
||||
<Content Include="Properties\Resources\Images\NewFolder.png" />
|
||||
<Content Include="Properties\Resources\Images\Refresh.png" />
|
||||
<Content Include="Properties\Resources\Images\Skype.png" />
|
||||
<Content Include="Properties\Resources\Texts\EnhanceMenusDic.xml" />
|
||||
<Content Include="Properties\Resources\Images\About.png" />
|
||||
<Content Include="Properties\Resources\Images\Add.png" />
|
||||
|
||||
@@ -77,10 +77,10 @@ namespace ContextMenuManager.Controls
|
||||
|
||||
readonly TabPage[] pages = new TabPage[] {
|
||||
new TabPage(AppString.Other.DictionaryDescription),
|
||||
new TabPage(AppString.Other.LanguageDictionary),
|
||||
new TabPage(AppString.SideBar.AppLanguage),
|
||||
new TabPage(AppString.Other.GuidInfosDictionary),
|
||||
new TabPage(AppString.Other.ThridRulesDictionary),
|
||||
new TabPage(AppString.Other.CommonItemsDictionary)
|
||||
new TabPage(AppString.SideBar.ThirdRules),
|
||||
new TabPage(AppString.SideBar.EnhanceMenu)
|
||||
};
|
||||
readonly ReadOnlyRichTextBox[] boxs = new ReadOnlyRichTextBox[5];
|
||||
readonly PictureButton btnOpenDir = new PictureButton(AppImage.Open)
|
||||
@@ -110,7 +110,7 @@ namespace ContextMenuManager.Controls
|
||||
dlg.FileName = AppConfig.GUIDINFOSDICINI;
|
||||
break;
|
||||
case 3:
|
||||
dlg.FileName = AppConfig.ThIRDRULESDICXML;
|
||||
dlg.FileName = AppConfig.THIRDRULESDICXML;
|
||||
break;
|
||||
case 4:
|
||||
dlg.FileName = AppConfig.ENHANCEMENUSICXML;
|
||||
@@ -437,8 +437,8 @@ namespace ContextMenuManager.Controls
|
||||
|
||||
public void LoadItems()
|
||||
{
|
||||
this.AddItems(new[] { mliUpdate, mliConfigDir, mliBackup, mliProtect,
|
||||
mliEngine, mliWinXSortable, mliShowFilePath, mliOpenMoreRegedit });
|
||||
this.AddItems(new[] { mliUpdate, mliConfigDir, mliEngine, mliBackup,
|
||||
mliProtect, mliWinXSortable, mliShowFilePath, mliOpenMoreRegedit });
|
||||
cmbConfigDir.SelectedIndex = AppConfig.SaveToAppDir ? 1 : 0;
|
||||
chkBackup.Checked = AppConfig.AutoBackup;
|
||||
chkProtect.Checked = AppConfig.ProtectOpenItem;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace ContextMenuManager.Controls
|
||||
sealed class AddGuidDicDialog : CommonDialog
|
||||
{
|
||||
public Image ItemIcon { get; set; }
|
||||
public string ItemName { get; set; }
|
||||
public string ItemText { get; set; }
|
||||
public bool IsDelete { get; private set; }
|
||||
public string ItemIconPath { get; set; }
|
||||
public int ItemIconIndex { get; set; }
|
||||
@@ -28,14 +28,14 @@ namespace ContextMenuManager.Controls
|
||||
{
|
||||
using(AddGuidDicForm frm = new AddGuidDicForm())
|
||||
{
|
||||
frm.ItemName = this.ItemName;
|
||||
frm.ItemText = this.ItemText;
|
||||
frm.ItemIcon = this.ItemIcon;
|
||||
frm.ItemIconPath = this.ItemIconPath;
|
||||
frm.ItemIconIndex = this.ItemIconIndex;
|
||||
bool flag = frm.ShowDialog() == DialogResult.OK;
|
||||
if(flag)
|
||||
{
|
||||
this.ItemName = frm.ItemName;
|
||||
this.ItemText = frm.ItemText;
|
||||
this.ItemIcon = frm.ItemIcon;
|
||||
this.ItemIconPath = frm.ItemIconPath;
|
||||
this.ItemIconIndex = frm.ItemIconIndex;
|
||||
@@ -60,7 +60,7 @@ namespace ContextMenuManager.Controls
|
||||
InitializeComponents();
|
||||
}
|
||||
|
||||
public string ItemName
|
||||
public string ItemText
|
||||
{
|
||||
get => txtName.Text;
|
||||
set => txtName.Text = value;
|
||||
|
||||
@@ -14,7 +14,9 @@ namespace ContextMenuManager.Controls
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach(XmlNode xn in ReadXml().DocumentElement.ChildNodes)
|
||||
XmlDocument doc = AppDic.ReadXml(AppConfig.WebEnhanceMenusDic,
|
||||
AppConfig.UserEnhanceMenusDic, Properties.Resources.EnhanceMenusDic);
|
||||
foreach(XmlNode xn in doc.DocumentElement.ChildNodes)
|
||||
{
|
||||
|
||||
GroupPathItem groupItem = GetGroupPathItem(xn);
|
||||
@@ -97,34 +99,6 @@ namespace ContextMenuManager.Controls
|
||||
return groupItem;
|
||||
}
|
||||
|
||||
private XmlDocument ReadXml()
|
||||
{
|
||||
XmlDocument doc1 = new XmlDocument();
|
||||
try
|
||||
{
|
||||
if(File.Exists(AppConfig.WebEnhanceMenusDic))
|
||||
{
|
||||
doc1.LoadXml(File.ReadAllText(AppConfig.WebEnhanceMenusDic, EncodingType.GetType(AppConfig.WebEnhanceMenusDic)));
|
||||
}
|
||||
else
|
||||
{
|
||||
doc1.LoadXml(Properties.Resources.EnhanceMenusDic);
|
||||
}
|
||||
if(File.Exists(AppConfig.UserEnhanceMenusDic))
|
||||
{
|
||||
XmlDocument doc2 = new XmlDocument();
|
||||
doc2.LoadXml(File.ReadAllText(AppConfig.UserEnhanceMenusDic, EncodingType.GetType(AppConfig.UserEnhanceMenusDic)));
|
||||
foreach(XmlNode xn in doc2.DocumentElement.ChildNodes)
|
||||
{
|
||||
XmlNode node = doc1.ImportNode(xn, true);
|
||||
doc1.DocumentElement.AppendChild(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return doc1;
|
||||
}
|
||||
|
||||
private void LoadShellItems(XmlElement shellXE, GroupPathItem groupItem)
|
||||
{
|
||||
foreach(XmlElement itemXE in shellXE.SelectNodes("Item"))
|
||||
|
||||
@@ -6,12 +6,8 @@ using System.Windows.Forms;
|
||||
|
||||
namespace ContextMenuManager.Controls
|
||||
{
|
||||
class GuidBlockedItem : MyListItem, IBtnDeleteItem, ITsiWebSearchItem, ITsiFilePathItem
|
||||
class GuidBlockedItem : MyListItem, IBtnDeleteItem, ITsiWebSearchItem, ITsiFilePathItem, ITsiGuidItem
|
||||
{
|
||||
public const string HKLMBLOCKED = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked";
|
||||
public const string HKCUBLOCKED = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked";
|
||||
public static readonly string[] BlockedPaths = { HKLMBLOCKED, HKCUBLOCKED };
|
||||
|
||||
public GuidBlockedItem(string value)
|
||||
{
|
||||
InitializeComponents();
|
||||
@@ -19,32 +15,49 @@ namespace ContextMenuManager.Controls
|
||||
if(GuidEx.TryParse(value, out Guid guid))
|
||||
{
|
||||
this.Guid = guid;
|
||||
this.Text = GuidInfo.GetText(guid);
|
||||
this.Image = GuidInfo.GetImage(guid);
|
||||
this.ItemFilePath = GuidInfo.GetFilePath(Guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Guid = Guid.Empty;
|
||||
this.Text = AppString.MessageBox.MalformedGuid;
|
||||
this.Image = AppImage.DllDefaultIcon;
|
||||
}
|
||||
this.Text += "\n" + value;
|
||||
this.Text = this.ItemText;
|
||||
}
|
||||
|
||||
public string Value { get; set; }
|
||||
public Guid Guid { get; set; }
|
||||
|
||||
public DeleteButton BtnDelete { get; set; }
|
||||
public ObjectPathButton BtnOpenPath { get; set; }
|
||||
public string ItemText
|
||||
{
|
||||
get
|
||||
{
|
||||
string text;
|
||||
if(GuidEx.TryParse(Value, out Guid guid))
|
||||
{
|
||||
text = GuidInfo.GetText(guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
text = AppString.MessageBox.MalformedGuid;
|
||||
}
|
||||
text += "\n" + Value;
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string SearchText => Value;
|
||||
public string ItemFilePath { get; set; }
|
||||
|
||||
public DeleteButton BtnDelete { get; set; }
|
||||
public ObjectPathButton BtnOpenPath { get; set; }
|
||||
public WebSearchMenuItem TsiSearch { get; set; }
|
||||
public FileLocationMenuItem TsiFileLocation { get; set; }
|
||||
public FilePropertiesMenuItem TsiFileProperties { get; set; }
|
||||
public string RegPath { get; set; }
|
||||
public HandleGuidMenuItem TsiHandleGuid { get; set; }
|
||||
|
||||
readonly ToolStripMenuItem TsiDetails = new ToolStripMenuItem(AppString.Menu.Details);
|
||||
|
||||
private void InitializeComponents()
|
||||
{
|
||||
@@ -53,16 +66,19 @@ namespace ContextMenuManager.Controls
|
||||
TsiSearch = new WebSearchMenuItem(this);
|
||||
TsiFileProperties = new FilePropertiesMenuItem(this);
|
||||
TsiFileLocation = new FileLocationMenuItem(this);
|
||||
TsiHandleGuid = new HandleGuidMenuItem(this, false);
|
||||
|
||||
ContextMenuStrip.Items.AddRange(new ToolStripItem[] {TsiSearch,
|
||||
new ToolStripSeparator(), TsiFileProperties, TsiFileLocation });
|
||||
ContextMenuStrip.Items.AddRange(new ToolStripItem[] {TsiHandleGuid,
|
||||
new ToolStripSeparator(), TsiDetails });
|
||||
TsiDetails.DropDownItems.AddRange(new ToolStripItem[] { TsiSearch,
|
||||
new ToolStripSeparator(), TsiFileProperties, TsiFileLocation});
|
||||
|
||||
MyToolTip.SetToolTip(BtnDelete, AppString.Menu.Delete);
|
||||
}
|
||||
|
||||
public void DeleteMe()
|
||||
{
|
||||
Array.ForEach(BlockedPaths, path => { RegistryEx.DeleteValue(path, this.Value); });
|
||||
Array.ForEach(GuidBlockedList.BlockedPaths, path => RegistryEx.DeleteValue(path, this.Value));
|
||||
if(!this.Guid.Equals(Guid.Empty)) ExplorerRestarter.Show();
|
||||
this.Dispose();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ namespace ContextMenuManager.Controls
|
||||
{
|
||||
sealed class GuidBlockedList : MyList
|
||||
{
|
||||
public const string HKLMBLOCKED = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked";
|
||||
public const string HKCUBLOCKED = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked";
|
||||
public static readonly string[] BlockedPaths = { HKLMBLOCKED, HKCUBLOCKED };
|
||||
|
||||
public void LoadItems()
|
||||
{
|
||||
this.AddNewItem();
|
||||
@@ -19,15 +23,14 @@ namespace ContextMenuManager.Controls
|
||||
private void LoadBlockedItems()
|
||||
{
|
||||
List<string> values = new List<string>();
|
||||
Array.ForEach(GuidBlockedItem.BlockedPaths, path =>
|
||||
Array.ForEach(BlockedPaths, path =>
|
||||
{
|
||||
using(RegistryKey key = RegistryEx.GetRegistryKey(path))
|
||||
if(key != null) values.AddRange(key.GetValueNames());
|
||||
});
|
||||
Array.ForEach(values.Distinct(StringComparer.OrdinalIgnoreCase).ToArray(), value =>
|
||||
{
|
||||
this.AddItem(new GuidBlockedItem(value));
|
||||
});
|
||||
this.AddItem(new GuidBlockedItem(value))
|
||||
);
|
||||
}
|
||||
|
||||
private void AddNewItem()
|
||||
@@ -42,10 +45,8 @@ namespace ContextMenuManager.Controls
|
||||
if(dlg.ShowDialog() != DialogResult.OK) return;
|
||||
if(GuidEx.TryParse(dlg.Text, out guid))
|
||||
{
|
||||
Array.ForEach(GuidBlockedItem.BlockedPaths, path =>
|
||||
{
|
||||
Registry.SetValue(path, guid.ToString("B"), string.Empty);
|
||||
});
|
||||
string value = guid.ToString("B");
|
||||
Array.ForEach(BlockedPaths, path => Registry.SetValue(path, value, ""));
|
||||
for(int i = 1; i < Controls.Count; i++)
|
||||
{
|
||||
if(((GuidBlockedItem)Controls[i]).Guid.Equals(guid))
|
||||
@@ -54,7 +55,7 @@ namespace ContextMenuManager.Controls
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.InsertItem(new GuidBlockedItem(dlg.Text), 1);
|
||||
this.InsertItem(new GuidBlockedItem(value), 1);
|
||||
ExplorerRestarter.Show();
|
||||
}
|
||||
else MessageBoxEx.Show(AppString.MessageBox.MalformedGuid);
|
||||
|
||||
148
ContextMenuManager/Controls/Interfaces/ITsiGuidItem.cs
Normal file
148
ContextMenuManager/Controls/Interfaces/ITsiGuidItem.cs
Normal file
@@ -0,0 +1,148 @@
|
||||
using BluePointLilac.Controls;
|
||||
using BluePointLilac.Methods;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ContextMenuManager.Controls.Interfaces
|
||||
{
|
||||
interface ITsiGuidItem
|
||||
{
|
||||
Guid Guid { get; }
|
||||
string ItemText { get; }
|
||||
HandleGuidMenuItem TsiHandleGuid { get; set; }
|
||||
}
|
||||
|
||||
sealed class HandleGuidMenuItem : ToolStripMenuItem
|
||||
{
|
||||
public HandleGuidMenuItem(ITsiGuidItem item, bool isShellExItem) : base(AppString.Menu.HandleGuid)
|
||||
{
|
||||
this.Item = item;
|
||||
this.DropDownItems.Add(TsiCopyGuid);
|
||||
if(isShellExItem)
|
||||
{
|
||||
this.DropDownItems.Add(new ToolStripSeparator());
|
||||
this.DropDownItems.Add(TsiBlockGuid);
|
||||
}
|
||||
this.DropDownItems.Add(new ToolStripSeparator());
|
||||
this.DropDownItems.Add(TsiAddGuidDic);
|
||||
TsiCopyGuid.Click += (sender, e) => CopyGuid();
|
||||
TsiBlockGuid.Click += (sender, e) => BlockGuid();
|
||||
TsiAddGuidDic.Click += (sender, e) => AddGuidDic();
|
||||
((Control)item).ContextMenuStrip.Opening += (sender, e) =>
|
||||
{
|
||||
TsiBlockGuid.Checked = false;
|
||||
foreach(string path in GuidBlockedList.BlockedPaths)
|
||||
{
|
||||
if(Registry.GetValue(path, Item.Guid.ToString("B"), null) != null)
|
||||
{
|
||||
TsiBlockGuid.Checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
readonly ToolStripMenuItem TsiCopyGuid = new ToolStripMenuItem(AppString.Menu.CopyGuid);
|
||||
readonly ToolStripMenuItem TsiBlockGuid = new ToolStripMenuItem(AppString.Menu.BlockGuid);
|
||||
readonly ToolStripMenuItem TsiAddGuidDic = new ToolStripMenuItem(AppString.Menu.AddGuidDic);
|
||||
|
||||
public ITsiGuidItem Item { get; set; }
|
||||
|
||||
private void CopyGuid()
|
||||
{
|
||||
Clipboard.SetText(Item.Guid.ToString());
|
||||
MessageBoxEx.Show($"{AppString.MessageBox.CopiedToClipboard}\n{Item.Guid}",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private void BlockGuid()
|
||||
{
|
||||
foreach(string path in GuidBlockedList.BlockedPaths)
|
||||
{
|
||||
if(TsiBlockGuid.Checked)
|
||||
{
|
||||
RegistryEx.DeleteValue(path, Item.Guid.ToString("B"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Registry.SetValue(path, Item.Guid.ToString("B"), string.Empty);
|
||||
}
|
||||
}
|
||||
ExplorerRestarter.Show();
|
||||
}
|
||||
|
||||
private void AddGuidDic()
|
||||
{
|
||||
using(AddGuidDicDialog dlg = new AddGuidDicDialog())
|
||||
{
|
||||
dlg.ItemText = GuidInfo.GetText(Item.Guid);
|
||||
dlg.ItemIcon = GuidInfo.GetImage(Item.Guid);
|
||||
var location = GuidInfo.GetIconLocation(Item.Guid);
|
||||
dlg.ItemIconPath = location.IconPath;
|
||||
dlg.ItemIconIndex = location.IconIndex;
|
||||
IniWriter writer = new IniWriter
|
||||
{
|
||||
FilePath = AppConfig.UserGuidInfosDic,
|
||||
DeleteFileWhenEmpty = true
|
||||
};
|
||||
string section = Item.Guid.ToString();
|
||||
if(dlg.ShowDialog() != DialogResult.OK)
|
||||
{
|
||||
if(dlg.IsDelete)
|
||||
{
|
||||
writer.DeleteSection(section);
|
||||
GuidInfo.ItemTextDic.Remove(Item.Guid);
|
||||
GuidInfo.ItemImageDic.Remove(Item.Guid);
|
||||
GuidInfo.IconLocationDic.Remove(Item.Guid);
|
||||
GuidInfo.UserDic.RootDic.Remove(section);
|
||||
((MyListItem)Item).Text = Item.ItemText;
|
||||
((MyListItem)Item).Image = GuidInfo.GetImage(Item.Guid);
|
||||
}
|
||||
return;
|
||||
}
|
||||
string name = ResourceString.GetDirectString(dlg.ItemText);
|
||||
if(!name.IsNullOrWhiteSpace())
|
||||
{
|
||||
writer.SetValue(section, "Text", dlg.ItemText);
|
||||
((MyListItem)Item).Text = name;
|
||||
if(GuidInfo.ItemTextDic.ContainsKey(Item.Guid))
|
||||
{
|
||||
GuidInfo.ItemTextDic[Item.Guid] = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
GuidInfo.ItemTextDic.Add(Item.Guid, name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxEx.Show(AppString.MessageBox.StringParsingFailed);
|
||||
return;
|
||||
}
|
||||
if(dlg.ItemIconLocation != null)
|
||||
{
|
||||
writer.SetValue(section, "Icon", dlg.ItemIconLocation);
|
||||
location = new GuidInfo.IconLocation { IconPath = dlg.ItemIconPath, IconIndex = dlg.ItemIconIndex };
|
||||
if(GuidInfo.IconLocationDic.ContainsKey(Item.Guid))
|
||||
{
|
||||
GuidInfo.IconLocationDic[Item.Guid] = location;
|
||||
}
|
||||
else
|
||||
{
|
||||
GuidInfo.IconLocationDic.Add(Item.Guid, location);
|
||||
}
|
||||
((MyListItem)Item).Image = dlg.ItemIcon;
|
||||
if(GuidInfo.ItemImageDic.ContainsKey(Item.Guid))
|
||||
{
|
||||
GuidInfo.ItemImageDic[Item.Guid] = dlg.ItemIcon;
|
||||
}
|
||||
else
|
||||
{
|
||||
GuidInfo.ItemImageDic.Add(Item.Guid, dlg.ItemIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace ContextMenuManager.Controls.Interfaces
|
||||
interface ITsiRegExportItem
|
||||
{
|
||||
string Text { get; set; }
|
||||
string RegPath { get; set; }
|
||||
string RegPath { get; }
|
||||
ContextMenuStrip ContextMenuStrip { get; set; }
|
||||
RegExportMenuItem TsiRegExport { get; set; }
|
||||
}
|
||||
|
||||
@@ -149,7 +149,6 @@ namespace ContextMenuManager.Controls
|
||||
const string CU_SMWCE = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer";
|
||||
const string LM_SPMWE = @"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer";
|
||||
const string CU_SPMWE = @"HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer";
|
||||
public const string SkypeGuid = "{776dbc8d-7347-478c-8d71-791e12ef49d8}";
|
||||
|
||||
public static RuleAndInfo CustomFolder = new RuleAndInfo
|
||||
{
|
||||
@@ -237,21 +236,6 @@ namespace ContextMenuManager.Controls
|
||||
Image = AppImage.MicrosoftStore
|
||||
}
|
||||
};
|
||||
|
||||
public static RuleAndInfo ShareWithSkype = new RuleAndInfo
|
||||
{
|
||||
Rules = new[]
|
||||
{
|
||||
new RegRule(GuidBlockedItem.HKLMBLOCKED, SkypeGuid, null, "", RegistryValueKind.String),
|
||||
new RegRule(GuidBlockedItem.HKCUBLOCKED, SkypeGuid, null, "", RegistryValueKind.String)
|
||||
},
|
||||
ItemInfo = new ItemInfo
|
||||
{
|
||||
Text = AppString.Item.ShareWithSkype,
|
||||
Image = AppImage.Skype,
|
||||
RestartExplorer = true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
sealed class NumberRegRuleItem : RuleItem, ITsiRegPathItem
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Windows.Forms;
|
||||
|
||||
namespace ContextMenuManager.Controls
|
||||
{
|
||||
sealed class ShellExItem : MyListItem, IChkVisibleItem, IBtnShowMenuItem, IFoldSubItem,
|
||||
sealed class ShellExItem : MyListItem, IChkVisibleItem, IBtnShowMenuItem, IFoldSubItem, ITsiGuidItem,
|
||||
ITsiWebSearchItem, ITsiFilePathItem, ITsiRegPathItem, ITsiRegDeleteItem, ITsiRegExportItem
|
||||
{
|
||||
public static Dictionary<string, Guid> GetPathAndGuids(string shellExPath, bool isDragDrop = false)
|
||||
@@ -68,8 +68,8 @@ namespace ContextMenuManager.Controls
|
||||
private string ShellExPath => RegistryEx.GetParentPath(ParentPath);
|
||||
private string ParentKeyName => RegistryEx.GetKeyName(ParentPath);
|
||||
private string DefaultValue => Registry.GetValue(RegPath, "", null)?.ToString();
|
||||
public string ItemText => GuidInfo.GetText(Guid) ?? ((Guid.ToString("B") == KeyName) ? DefaultValue : KeyName);
|
||||
private GuidInfo.IconLocation IconLocation => GuidInfo.GetIconLocation(this.Guid);
|
||||
public string ItemText => GuidInfo.GetText(Guid) ?? (KeyName.Equals(Guid.ToString("B"), StringComparison.OrdinalIgnoreCase) ? DefaultValue : KeyName);
|
||||
private GuidInfo.IconLocation IconLocation => GuidInfo.GetIconLocation(Guid);
|
||||
private bool IsOpenLnkItem => Guid.ToString() == LnkOpenGuid;
|
||||
public bool IsDragDropItem => ParentKeyName.EndsWith(DdhParts[0], StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
@@ -114,12 +114,9 @@ namespace ContextMenuManager.Controls
|
||||
public DeleteMeMenuItem TsiDeleteMe { get; set; }
|
||||
public RegExportMenuItem TsiRegExport { get; set; }
|
||||
public IFoldGroupItem FoldGroupItem { get; set; }
|
||||
public HandleGuidMenuItem TsiHandleGuid { get; set; }
|
||||
|
||||
readonly ToolStripMenuItem TsiDetails = new ToolStripMenuItem(AppString.Menu.Details);
|
||||
readonly ToolStripMenuItem TsiHandleGuid = new ToolStripMenuItem(AppString.Menu.HandleGuid);
|
||||
readonly ToolStripMenuItem TsiCopyGuid = new ToolStripMenuItem(AppString.Menu.CopyGuid);
|
||||
readonly ToolStripMenuItem TsiBlockGuid = new ToolStripMenuItem(AppString.Menu.BlockGuid);
|
||||
readonly ToolStripMenuItem TsiAddGuidDic = new ToolStripMenuItem(AppString.Menu.AddGuidDic);
|
||||
|
||||
private void InitializeComponents()
|
||||
{
|
||||
@@ -131,129 +128,15 @@ namespace ContextMenuManager.Controls
|
||||
TsiRegLocation = new RegLocationMenuItem(this);
|
||||
TsiRegExport = new RegExportMenuItem(this);
|
||||
TsiDeleteMe = new DeleteMeMenuItem(this);
|
||||
TsiHandleGuid = new HandleGuidMenuItem(this, true);
|
||||
|
||||
ContextMenuStrip.Items.AddRange(new ToolStripItem[] { TsiHandleGuid, new ToolStripSeparator(),
|
||||
TsiDetails, new ToolStripSeparator(), TsiDeleteMe });
|
||||
|
||||
TsiHandleGuid.DropDownItems.AddRange(new ToolStripItem[] { TsiCopyGuid, new ToolStripSeparator(),
|
||||
TsiBlockGuid, new ToolStripSeparator(), TsiAddGuidDic });
|
||||
|
||||
TsiDetails.DropDownItems.AddRange(new ToolStripItem[] { TsiSearch, new ToolStripSeparator(),
|
||||
TsiFileProperties, TsiFileLocation, TsiRegLocation, TsiRegExport});
|
||||
|
||||
ContextMenuStrip.Opening += (sender, e) => RefreshMenuItem();
|
||||
TsiCopyGuid.Click += (sender, e) => CopyGuid();
|
||||
TsiBlockGuid.Click += (sender, e) => BlockGuid();
|
||||
TsiAddGuidDic.Click += (sender, e) => AddGuidDic();
|
||||
}
|
||||
|
||||
private void CopyGuid()
|
||||
{
|
||||
Clipboard.SetText(Guid.ToString());
|
||||
MessageBoxEx.Show($"{AppString.MessageBox.CopiedToClipboard}\n{Guid}",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private void BlockGuid()
|
||||
{
|
||||
foreach(string path in GuidBlockedItem.BlockedPaths)
|
||||
{
|
||||
if(TsiBlockGuid.Checked)
|
||||
{
|
||||
RegistryEx.DeleteValue(path, this.Guid.ToString("B"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Registry.SetValue(path, this.Guid.ToString("B"), string.Empty);
|
||||
}
|
||||
}
|
||||
ExplorerRestarter.Show();
|
||||
}
|
||||
|
||||
private void AddGuidDic()
|
||||
{
|
||||
using(AddGuidDicDialog dlg = new AddGuidDicDialog())
|
||||
{
|
||||
dlg.ItemName = this.Text;
|
||||
dlg.ItemIcon = this.Image;
|
||||
dlg.ItemIconPath = this.IconLocation.IconPath;
|
||||
dlg.ItemIconIndex = this.IconLocation.IconIndex;
|
||||
IniWriter writer = new IniWriter
|
||||
{
|
||||
FilePath = AppConfig.UserGuidInfosDic,
|
||||
DeleteFileWhenEmpty = true
|
||||
};
|
||||
string section = this.Guid.ToString();
|
||||
if(dlg.ShowDialog() != DialogResult.OK)
|
||||
{
|
||||
if(dlg.IsDelete)
|
||||
{
|
||||
writer.DeleteSection(section);
|
||||
GuidInfo.ItemTextDic.Remove(this.Guid);
|
||||
GuidInfo.ItemImageDic.Remove(this.Guid);
|
||||
GuidInfo.IconLocationDic.Remove(this.Guid);
|
||||
GuidInfo.UserDic.RootDic.Remove(section);
|
||||
this.Text = this.ItemText;
|
||||
this.Image = GuidInfo.GetImage(Guid);
|
||||
}
|
||||
return;
|
||||
}
|
||||
string name = ResourceString.GetDirectString(dlg.ItemName);
|
||||
if(!name.IsNullOrWhiteSpace())
|
||||
{
|
||||
writer.SetValue(section, "Text", dlg.ItemName);
|
||||
this.Text = name;
|
||||
if(GuidInfo.ItemTextDic.ContainsKey(this.Guid))
|
||||
{
|
||||
GuidInfo.ItemTextDic[this.Guid] = this.Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
GuidInfo.ItemTextDic.Add(this.Guid, this.Text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxEx.Show(AppString.MessageBox.StringParsingFailed);
|
||||
return;
|
||||
}
|
||||
if(dlg.ItemIconLocation != null)
|
||||
{
|
||||
writer.SetValue(section, "Icon", dlg.ItemIconLocation);
|
||||
var location = new GuidInfo.IconLocation { IconPath = dlg.ItemIconPath, IconIndex = dlg.ItemIconIndex };
|
||||
if(GuidInfo.IconLocationDic.ContainsKey(this.Guid))
|
||||
{
|
||||
GuidInfo.IconLocationDic[this.Guid] = location;
|
||||
}
|
||||
else
|
||||
{
|
||||
GuidInfo.IconLocationDic.Add(this.Guid, location);
|
||||
}
|
||||
this.Image = dlg.ItemIcon;
|
||||
if(GuidInfo.ItemImageDic.ContainsKey(this.Guid))
|
||||
{
|
||||
GuidInfo.ItemImageDic[this.Guid] = this.Image;
|
||||
}
|
||||
else
|
||||
{
|
||||
GuidInfo.ItemImageDic.Add(this.Guid, this.Image);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshMenuItem()
|
||||
{
|
||||
TsiDeleteMe.Enabled = !(IsOpenLnkItem && AppConfig.ProtectOpenItem);
|
||||
TsiBlockGuid.Checked = false;
|
||||
foreach(string path in GuidBlockedItem.BlockedPaths)
|
||||
{
|
||||
if(Registry.GetValue(path, this.Guid.ToString("B"), null) != null)
|
||||
{
|
||||
TsiBlockGuid.Checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ContextMenuStrip.Opening += (sender, e) => TsiDeleteMe.Enabled = !(IsOpenLnkItem && AppConfig.ProtectOpenItem);
|
||||
}
|
||||
|
||||
private bool TryProtectOpenItem()
|
||||
|
||||
@@ -5,8 +5,10 @@ using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
|
||||
namespace ContextMenuManager.Controls
|
||||
{
|
||||
@@ -155,19 +157,9 @@ namespace ContextMenuManager.Controls
|
||||
}
|
||||
this.AddNewItem(scenePath);
|
||||
this.LoadItems(scenePath);
|
||||
if(WindowsOsVersion.ISAfterOrEqual10) this.AddUwpModeItem();
|
||||
switch(Scene)
|
||||
{
|
||||
case Scenes.File:
|
||||
bool flag = WindowsOsVersion.ISAfterOrEqual10;
|
||||
if(flag)
|
||||
{
|
||||
using(RegistryKey key = RegistryEx.GetRegistryKey(@"HKEY_CLASSES_ROOT\PackagedCom\Package"))
|
||||
{
|
||||
flag = key != null && key.GetSubKeyNames().ToList().Any(name => name.StartsWith("Microsoft.SkypeApp", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
if(flag) this.AddItem(new VisibleRegRuleItem(VisibleRegRuleItem.ShareWithSkype));
|
||||
break;
|
||||
case Scenes.Background:
|
||||
this.AddItem(new VisibleRegRuleItem(VisibleRegRuleItem.CustomFolder));
|
||||
break;
|
||||
@@ -281,13 +273,14 @@ namespace ContextMenuManager.Controls
|
||||
newItem.AddNewItem += (sender, e) =>
|
||||
{
|
||||
bool isShell;
|
||||
if(Scene == Scenes.DragDrop) isShell = false;
|
||||
if(Scene == Scenes.CommandStore) isShell = true;
|
||||
else if(Scene == Scenes.DragDrop) isShell = false;
|
||||
else
|
||||
{
|
||||
using(SelectDialog dlg = new SelectDialog())
|
||||
{
|
||||
dlg.Items = new[] { "Shell", "ShellEx" };
|
||||
dlg.Title = "请选择新建菜单类型";
|
||||
dlg.Title = AppString.Dialog.SelectNewItemType;
|
||||
dlg.Selected = dlg.Items[0];
|
||||
if(dlg.ShowDialog() != DialogResult.OK) return;
|
||||
isShell = dlg.SelectedIndex == 0;
|
||||
@@ -310,7 +303,10 @@ namespace ContextMenuManager.Controls
|
||||
{
|
||||
if(this.Controls[i] is NewItem)
|
||||
{
|
||||
this.InsertItem(new ShellItem(dlg.NewItemRegPath), i + 1);
|
||||
ShellItem item;
|
||||
if(Scene != Scenes.CommandStore) item = new ShellItem(dlg.NewItemRegPath);
|
||||
else item = new StoreShellItem(dlg.NewItemRegPath, true, false);
|
||||
this.InsertItem(item, i + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -399,9 +395,33 @@ namespace ContextMenuManager.Controls
|
||||
{
|
||||
Array.ForEach(Array.FindAll(shellKey.GetSubKeyNames(), itemName =>
|
||||
!ShellItem.SysStoreItemNames.Contains(itemName, StringComparer.OrdinalIgnoreCase)), itemName =>
|
||||
this.AddItem(new StoreShellItem($@"{ShellItem.CommandStorePath}\{itemName}", true, false)));
|
||||
}
|
||||
}
|
||||
|
||||
private void AddUwpModeItem()
|
||||
{
|
||||
XmlDocument doc = AppDic.ReadXml(AppConfig.WebUwpModeItemsDic,
|
||||
AppConfig.UserUwpModeItemsDic, Properties.Resources.UwpModeItemsDic);
|
||||
List<Guid> guids = new List<Guid>();
|
||||
foreach(XmlElement sceneXE in doc.DocumentElement.ChildNodes)
|
||||
{
|
||||
if(sceneXE.Name == Scene.ToString())
|
||||
{
|
||||
foreach(XmlElement itemXE in sceneXE.ChildNodes)
|
||||
{
|
||||
this.AddItem(new StoreShellItem($@"{ShellItem.CommandStorePath}\{itemName}", true, false));
|
||||
});
|
||||
if(GuidEx.TryParse(itemXE.GetAttribute("Guid"), out Guid guid))
|
||||
{
|
||||
if(guids.Contains(guid)) continue;
|
||||
string uwpName = GuidInfo.GetUwpName(guid);
|
||||
if(!string.IsNullOrEmpty(uwpName))
|
||||
{
|
||||
this.AddItem(new UwpModeItem(uwpName, guid));
|
||||
guids.Add(guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +121,8 @@ namespace ContextMenuManager.Controls
|
||||
if(isSelect)
|
||||
{
|
||||
this.AddCtr(chkSelected, 40.DpiZoom());
|
||||
this.ContextMenuStrip = null;
|
||||
this.SetNoClickEvent();
|
||||
ChkVisible.Visible = BtnShowMenu.Visible = BtnSubItems.Visible = false;
|
||||
}
|
||||
RegTrustedInstaller.TakeRegTreeOwnerShip(regPath);
|
||||
|
||||
@@ -14,7 +14,9 @@ namespace ContextMenuManager.Controls
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach(XmlElement groupXE in ReadXml().DocumentElement.ChildNodes)
|
||||
XmlDocument doc = AppDic.ReadXml(AppConfig.WebThirdRulesDic,
|
||||
AppConfig.UserThirdRulesDic, Properties.Resources.ThirdRulesDic);
|
||||
foreach(XmlElement groupXE in doc.DocumentElement.ChildNodes)
|
||||
{
|
||||
Guid guid = Guid.Empty;
|
||||
if(groupXE.HasAttribute("Guid"))
|
||||
@@ -164,34 +166,6 @@ namespace ContextMenuManager.Controls
|
||||
catch { }
|
||||
}
|
||||
|
||||
private XmlDocument ReadXml()
|
||||
{
|
||||
XmlDocument doc1 = new XmlDocument();
|
||||
try
|
||||
{
|
||||
if(File.Exists(AppConfig.WebThirdRulesDic))
|
||||
{
|
||||
doc1.LoadXml(File.ReadAllText(AppConfig.WebThirdRulesDic, EncodingType.GetType(AppConfig.WebThirdRulesDic)));
|
||||
}
|
||||
else
|
||||
{
|
||||
doc1.LoadXml(Properties.Resources.ThirdRulesDic);
|
||||
}
|
||||
if(File.Exists(AppConfig.UserThirdRulesDic))
|
||||
{
|
||||
XmlDocument doc2 = new XmlDocument();
|
||||
doc2.LoadXml(File.ReadAllText(AppConfig.UserThirdRulesDic, EncodingType.GetType(AppConfig.UserThirdRulesDic)));
|
||||
foreach(XmlNode xn in doc2.DocumentElement.ChildNodes)
|
||||
{
|
||||
XmlNode node = doc1.ImportNode(xn, true);
|
||||
doc1.DocumentElement.AppendChild(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return doc1;
|
||||
}
|
||||
|
||||
private static RegistryValueKind GetValueKind(string data)
|
||||
{
|
||||
switch(data.ToUpper())
|
||||
|
||||
136
ContextMenuManager/Controls/UwpModeItem.cs
Normal file
136
ContextMenuManager/Controls/UwpModeItem.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
using BluePointLilac.Controls;
|
||||
using BluePointLilac.Methods;
|
||||
using ContextMenuManager.Controls.Interfaces;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ContextMenuManager.Controls
|
||||
{
|
||||
sealed class UwpModeItem : MyListItem, IChkVisibleItem, ITsiRegPathItem, ITsiFilePathItem,
|
||||
IBtnShowMenuItem, ITsiWebSearchItem, ITsiRegExportItem, ITsiRegDeleteItem, ITsiGuidItem
|
||||
{
|
||||
private const string PackagePath = @"HKEY_CLASSES_ROOT\PackagedCom\Package";
|
||||
private const string AppXPath = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx";
|
||||
private static readonly string WindowAppsDir = Registry.GetValue(AppXPath, "PackageRoot", null)?.ToString();
|
||||
|
||||
public UwpModeItem(string uwpName, Guid guid)
|
||||
{
|
||||
this.Guid = guid;
|
||||
this.UwpName = uwpName;
|
||||
this.InitializeComponents();
|
||||
ChkVisible.Checked = ItemVisible;
|
||||
this.Visible = File.Exists(ItemFilePath);
|
||||
this.Image = GuidInfo.GetImage(guid);
|
||||
this.Text = this.ItemText;
|
||||
}
|
||||
|
||||
public Guid Guid { get; set; }
|
||||
public string UwpName { get; set; }
|
||||
|
||||
public bool ItemVisible
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach(string path in GuidBlockedList.BlockedPaths)
|
||||
{
|
||||
using(RegistryKey key = RegistryEx.GetRegistryKey(path))
|
||||
{
|
||||
if(key == null) continue;
|
||||
if(key.GetValue(Guid.ToString("B")) != null) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
set
|
||||
{
|
||||
foreach(string path in GuidBlockedList.BlockedPaths)
|
||||
{
|
||||
if(value)
|
||||
{
|
||||
RegistryEx.DeleteValue(path, Guid.ToString("B"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Registry.SetValue(path, Guid.ToString("B"), "");
|
||||
}
|
||||
}
|
||||
ExplorerRestarter.Show();
|
||||
}
|
||||
}
|
||||
|
||||
public string ItemText => GuidInfo.GetText(Guid);
|
||||
public string RegPath => GetGuidRegPath(UwpName, Guid);
|
||||
public string ItemFilePath => GetFilePath(UwpName, Guid);
|
||||
|
||||
public static string GetPackageName(string uwpName)
|
||||
{
|
||||
using(RegistryKey packageKey = RegistryEx.GetRegistryKey(PackagePath))
|
||||
{
|
||||
if(packageKey == null) return null;
|
||||
foreach(string packageName in packageKey.GetSubKeyNames())
|
||||
{
|
||||
if(packageName.StartsWith(uwpName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return packageName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string GetGuidRegPath(string uwpName, Guid guid)
|
||||
{
|
||||
string packageName = GetPackageName(uwpName);
|
||||
if(packageName == null) return null;
|
||||
else return $@"{PackagePath}\{packageName}\Class\{guid:B}";
|
||||
}
|
||||
|
||||
public static string GetFilePath(string uwpName, Guid guid)
|
||||
{
|
||||
string regPath = GetGuidRegPath(uwpName, guid);
|
||||
if(regPath == null) return null;
|
||||
string dirPath = $@"{WindowAppsDir}\{GetPackageName(uwpName)}";
|
||||
string path = Registry.GetValue(regPath, "DllPath", null)?.ToString();
|
||||
if(path.IsNullOrWhiteSpace()) return dirPath;
|
||||
else return $@"{dirPath}\{path}";
|
||||
}
|
||||
|
||||
public string SearchText => Text;
|
||||
public string ValueName => "DllPath";
|
||||
public MenuButton BtnShowMenu { get; set; }
|
||||
public VisibleCheckBox ChkVisible { get; set; }
|
||||
public RegLocationMenuItem TsiRegLocation { get; set; }
|
||||
public FileLocationMenuItem TsiFileLocation { get; set; }
|
||||
public FilePropertiesMenuItem TsiFileProperties { get; set; }
|
||||
public WebSearchMenuItem TsiSearch { get; set; }
|
||||
public DeleteMeMenuItem TsiDeleteMe { get; set; }
|
||||
public RegExportMenuItem TsiRegExport { get; set; }
|
||||
public HandleGuidMenuItem TsiHandleGuid { get; set; }
|
||||
readonly ToolStripMenuItem TsiDetails = new ToolStripMenuItem(AppString.Menu.Details);
|
||||
|
||||
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);
|
||||
TsiDeleteMe = new DeleteMeMenuItem(this);
|
||||
TsiRegExport = new RegExportMenuItem(this);
|
||||
TsiHandleGuid = new HandleGuidMenuItem(this, false);
|
||||
this.ContextMenuStrip.Items.AddRange(new ToolStripItem[] { TsiHandleGuid,
|
||||
new ToolStripSeparator(), TsiDetails, new ToolStripSeparator(), TsiDeleteMe });
|
||||
TsiDetails.DropDownItems.AddRange(new ToolStripItem[] { TsiSearch, new ToolStripSeparator(),
|
||||
TsiFileProperties, TsiFileLocation, TsiRegLocation, TsiRegExport });
|
||||
}
|
||||
|
||||
public void DeleteMe()
|
||||
{
|
||||
RegistryEx.DeleteKeyTree(this.RegPath);
|
||||
this.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,15 +24,6 @@ namespace ContextMenuManager
|
||||
public int IconIndex { get; set; }
|
||||
}
|
||||
|
||||
static GuidInfo()
|
||||
{
|
||||
//将Skype添加到字典
|
||||
Guid skypeGuid = new Guid(VisibleRegRuleItem.SkypeGuid);
|
||||
FilePathDic.Add(skypeGuid, null);
|
||||
ItemTextDic.Add(skypeGuid, AppString.Item.ShareWithSkype);
|
||||
ItemImageDic.Add(skypeGuid, AppImage.Skype);
|
||||
}
|
||||
|
||||
private static readonly IniReader AppDic = new IniReader(new StringBuilder(Properties.Resources.GuidInfosDic));
|
||||
public static readonly IniReader UserDic = new IniReader(AppConfig.UserGuidInfosDic);
|
||||
public static readonly IniReader WebDic = new IniReader(AppConfig.WebGuidInfosDic);
|
||||
@@ -40,10 +31,12 @@ namespace ContextMenuManager
|
||||
private static readonly Dictionary<Guid, string> FilePathDic = new Dictionary<Guid, string>();
|
||||
public static readonly Dictionary<Guid, string> ItemTextDic = new Dictionary<Guid, string>();
|
||||
public static readonly Dictionary<Guid, Image> ItemImageDic = new Dictionary<Guid, Image>();
|
||||
public static readonly Dictionary<Guid, string> UwpNameDic = new Dictionary<Guid, string>();
|
||||
|
||||
private static bool TryGetValue(string section, string key, out string value)
|
||||
private static bool TryGetValue(Guid guid, string key, out string value)
|
||||
{
|
||||
//用户自定义字典优先
|
||||
string section = guid.ToString();
|
||||
if(UserDic.TryGetValue(section, key, out value)) return true;
|
||||
if(WebDic.TryGetValue(section, key, out value)) return true;
|
||||
if(AppDic.TryGetValue(section, key, out value)) return true;
|
||||
@@ -57,30 +50,38 @@ namespace ContextMenuManager
|
||||
if(FilePathDic.ContainsKey(guid)) filePath = FilePathDic[guid];
|
||||
else
|
||||
{
|
||||
foreach(string clsidPath in ClsidPaths)
|
||||
string uwpName = GetUwpName(guid);
|
||||
if(!string.IsNullOrEmpty(uwpName))
|
||||
{
|
||||
using(RegistryKey guidKey = RegistryEx.GetRegistryKey($@"{clsidPath}\{guid:B}"))
|
||||
filePath = UwpModeItem.GetFilePath(uwpName, guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach(string clsidPath in ClsidPaths)
|
||||
{
|
||||
if(guidKey == null) continue;
|
||||
foreach(string keyName in new[] { "InprocServer32", "LocalServer32" })
|
||||
using(RegistryKey guidKey = RegistryEx.GetRegistryKey($@"{clsidPath}\{guid:B}"))
|
||||
{
|
||||
using(RegistryKey key = guidKey.OpenSubKey(keyName))
|
||||
if(guidKey == null) continue;
|
||||
foreach(string keyName in new[] { "InprocServer32", "LocalServer32" })
|
||||
{
|
||||
if(key == null) continue;
|
||||
string value1 = key.GetValue("CodeBase")?.ToString()?.Replace("file:///", "")?.Replace('/', '\\');
|
||||
if(File.Exists(value1))
|
||||
using(RegistryKey key = guidKey.OpenSubKey(keyName))
|
||||
{
|
||||
filePath = value1; break;
|
||||
}
|
||||
string value2 = key.GetValue("")?.ToString();
|
||||
value2 = ObjectPath.ExtractFilePath(value2);
|
||||
if(File.Exists(value2))
|
||||
{
|
||||
filePath = value2; break;
|
||||
if(key == null) continue;
|
||||
string value1 = key.GetValue("CodeBase")?.ToString()?.Replace("file:///", "")?.Replace('/', '\\');
|
||||
if(File.Exists(value1))
|
||||
{
|
||||
filePath = value1; break;
|
||||
}
|
||||
string value2 = key.GetValue("")?.ToString();
|
||||
value2 = ObjectPath.ExtractFilePath(value2);
|
||||
if(File.Exists(value2))
|
||||
{
|
||||
filePath = value2; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(File.Exists(filePath)) break;
|
||||
}
|
||||
if(File.Exists(filePath)) break;
|
||||
}
|
||||
}
|
||||
FilePathDic.Add(guid, filePath);
|
||||
@@ -95,7 +96,7 @@ namespace ContextMenuManager
|
||||
if(ItemTextDic.ContainsKey(guid)) itemText = ItemTextDic[guid];
|
||||
else
|
||||
{
|
||||
if(TryGetValue(guid.ToString(), "Text", out itemText))
|
||||
if(TryGetValue(guid, "Text", out itemText))
|
||||
{
|
||||
itemText = GetAbsStr(guid, itemText, true);
|
||||
itemText = ResourceString.GetDirectString(itemText);
|
||||
@@ -116,7 +117,7 @@ namespace ContextMenuManager
|
||||
if(itemText.IsNullOrWhiteSpace())
|
||||
{
|
||||
string filePath = GetFilePath(guid);
|
||||
if(filePath != null)
|
||||
if(File.Exists(filePath))
|
||||
{
|
||||
itemText = FileVersionInfo.GetVersionInfo(filePath).FileDescription;
|
||||
if(itemText.IsNullOrWhiteSpace())
|
||||
@@ -151,7 +152,7 @@ namespace ContextMenuManager
|
||||
if(IconLocationDic.ContainsKey(guid)) location = IconLocationDic[guid];
|
||||
else
|
||||
{
|
||||
if(TryGetValue(guid.ToString(), "Icon", out string value))
|
||||
if(TryGetValue(guid, "Icon", out string value))
|
||||
{
|
||||
value = GetAbsStr(guid, value, false);
|
||||
int index = value.LastIndexOf(',');
|
||||
@@ -168,6 +169,19 @@ namespace ContextMenuManager
|
||||
return location;
|
||||
}
|
||||
|
||||
public static string GetUwpName(Guid guid)
|
||||
{
|
||||
string uwpName = null;
|
||||
if(guid.Equals(Guid.Empty)) return uwpName;
|
||||
if(UwpNameDic.ContainsKey(guid)) uwpName = UwpNameDic[guid];
|
||||
else
|
||||
{
|
||||
TryGetValue(guid, "UwpName", out uwpName);
|
||||
UwpNameDic.Add(guid, uwpName);
|
||||
}
|
||||
return uwpName;
|
||||
}
|
||||
|
||||
private static string GetAbsStr(Guid guid, string relStr, bool isName)
|
||||
{
|
||||
string absStr = relStr;
|
||||
|
||||
25
ContextMenuManager/Properties/Resources.Designer.cs
generated
25
ContextMenuManager/Properties/Resources.Designer.cs
generated
@@ -312,16 +312,6 @@ namespace ContextMenuManager.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap Skype {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Skype", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
@@ -396,5 +386,20 @@ namespace ContextMenuManager.Properties {
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 [Microsoft.SkypeApp]
|
||||
///Guid=776dbc8d-7347-478c-8d71-791e12ef49d8
|
||||
///Scene=File
|
||||
///
|
||||
///[Microsoft.WindowsTerminal]
|
||||
///Guid=9f156763-7844-4dc4-b2b1-901f640f5155
|
||||
///Scene=Directory|Background 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string UwpModeItemsDic {
|
||||
get {
|
||||
return ResourceManager.GetString("UwpModeItemsDic", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,9 +178,6 @@
|
||||
<data name="Setting" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>resources\images\setting.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Skype" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>resources\images\skype.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Star" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>resources\images\star.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@@ -202,4 +199,7 @@
|
||||
<data name="Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>resources\images\up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="UwpModeItemsDic" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>resources\texts\uwpmodeitemsdic.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -137,7 +137,6 @@ RecycleBinProperties = 属性(&R)
|
||||
RemovableDrive = 可移动磁盘
|
||||
BuildSendtoMenu = 快速构建发送到子菜单
|
||||
UseStoreOpenWith = 在Microsoft Store中查找应用
|
||||
ShareWithSkype = 使用 Skype 共享
|
||||
NewItem = 新建一个菜单项目
|
||||
AddGuidBlockedItem = 添加GUID锁定项目
|
||||
LockNewMenu = 锁定新建菜单
|
||||
@@ -186,6 +185,7 @@ AudioDirectory = 音频目录
|
||||
CheckReference = 请勾选你想要引用的菜单项目
|
||||
CheckCopy = 请勾选你想要复制的菜单项目
|
||||
SelectGroup = 请选择保存分组
|
||||
SelectNewItemType = 请选择新建菜单类型
|
||||
SelectSubMenuMode = 该多级菜单子项目数为0, 你有两个选择:\n①该多级菜单的所有子菜单项目私有(推荐),\n②该多级菜单可与其他多级菜单引用相同子项,\n请做出你的选择......
|
||||
|
||||
[MessageBox]
|
||||
@@ -242,10 +242,7 @@ CreateGroup = 新建一个分组
|
||||
[Other]
|
||||
RestartExplorer = 当前部分操作需要重启文件资源管理器生效
|
||||
DictionaryDescription = 字典说明
|
||||
LanguageDictionary = 程序语言
|
||||
GuidInfosDictionary = GUID信息
|
||||
ThridRulesDictionary = 三方规则
|
||||
CommonItemsDictionary = 常用菜单
|
||||
Translators = 翻译贡献者
|
||||
OtherLanguages = 下载或上传其他语言文件
|
||||
DonationList = 捐赠名单
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
;----------------系统------------------
|
||||
;打开(快捷方式)
|
||||
[00021401-0000-0000-c000-000000000046]
|
||||
Text=@shell32.dll,-12850
|
||||
Text=打开(&O)
|
||||
Icon=shell32.dll,-16769
|
||||
;打开文件所在的位置(&I)
|
||||
[37ea3a21-7493-4208-a011-7f9ea79ce9f5]
|
||||
@@ -594,4 +594,14 @@ Text=Directory Lister
|
||||
Icon=.\DirListerPro.exe
|
||||
[8e57c449-7891-49bb-80e5-ddac375f8ac8]
|
||||
Text=使用微表格打开
|
||||
Icon=.\microexcel.exe
|
||||
Icon=.\microexcel.exe
|
||||
|
||||
;-------------UWP新模块----------------
|
||||
[776dbc8d-7347-478c-8d71-791e12ef49d8]
|
||||
UwpName=Microsoft.SkypeApp
|
||||
Text=@*,-101
|
||||
Icon=.\Skype.exe
|
||||
[9F156763-7844-4DC4-B2B1-901F640F5155]
|
||||
UwpName=Microsoft.WindowsTerminal
|
||||
Text=Open in Windows Terminal
|
||||
Icon=.\WindowsTerminal.exe
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!-- 微软在Win10右键菜单中新增的UWP模块, 非Shell、ShellEx类型,
|
||||
但是可通过GUID锁定屏蔽来禁用右键菜单项目,
|
||||
GUID查找位置:HKEY_CLASSES_ROOT\PackagedCom\Package\[包名]\Class\[GUID],
|
||||
Scene的各子节点为菜单项目出现位置, Item必须有Guid属性,
|
||||
UwpName、Text、Icon、Tip等属性可写在GuidInfosDic.ini里面,这里就可省略不写-->
|
||||
|
||||
<Scene>
|
||||
<File>
|
||||
<Item Guid='776dbc8d-7347-478c-8d71-791e12ef49d8'/>
|
||||
</File>
|
||||
<Directory>
|
||||
<Item Guid='9f156763-7844-4dc4-b2b1-901f640f5155'/>
|
||||
</Directory>
|
||||
<Background>
|
||||
<Item Guid='9f156763-7844-4dc4-b2b1-901f640f5155'/>
|
||||
</Background>
|
||||
</Scene>
|
||||
@@ -13,6 +13,7 @@ namespace ContextMenuManager
|
||||
const string GuidInfosDicUrl = "https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/ContextMenuManager/Properties/Resources/Texts/GuidInfosDic.ini";
|
||||
const string ThirdRulesDicUrl = "https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/ContextMenuManager/Properties/Resources/Texts/ThirdRulesDic.xml";
|
||||
const string EnhanceMenusDicUrl = "https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/ContextMenuManager/Properties/Resources/Texts/EnhanceMenusDic.xml";
|
||||
const string UwpModeItemsDicUrl = "https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/ContextMenuManager/Properties/Resources/Texts/UwpModeItemsDic.xml";
|
||||
|
||||
public static void PeriodicUpdate()
|
||||
{
|
||||
@@ -34,6 +35,7 @@ namespace ContextMenuManager
|
||||
UpdateText(AppConfig.WebGuidInfosDic, GuidInfosDicUrl);
|
||||
UpdateText(AppConfig.WebThirdRulesDic, ThirdRulesDicUrl);
|
||||
UpdateText(AppConfig.WebEnhanceMenusDic, EnhanceMenusDicUrl);
|
||||
UpdateText(AppConfig.WebUwpModeItemsDic, UwpModeItemsDicUrl);
|
||||
try { return UpdateApp(); } catch { return false; }
|
||||
}
|
||||
|
||||
|
||||
BIN
Screenshot.png
BIN
Screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 59 KiB |
@@ -137,7 +137,6 @@ RecycleBinProperties = 属性(&R)
|
||||
RemovableDrive = 可移动磁盘
|
||||
BuildSendtoMenu = 快速构建发送到子菜单
|
||||
UseStoreOpenWith = 在Microsoft Store中查找应用
|
||||
ShareWithSkype = 使用 Skype 共享
|
||||
NewItem = 新建一个菜单项目
|
||||
AddGuidBlockedItem = 添加GUID锁定项目
|
||||
LockNewMenu = 锁定新建菜单
|
||||
@@ -186,6 +185,7 @@ AudioDirectory = 音频目录
|
||||
CheckReference = 请勾选你想要引用的菜单项目
|
||||
CheckCopy = 请勾选你想要复制的菜单项目
|
||||
SelectGroup = 请选择保存分组
|
||||
SelectNewItemType = 请选择新建菜单类型
|
||||
SelectSubMenuMode = 该多级菜单子项目数为0, 你有两个选择:\n①该多级菜单的所有子菜单项目私有(推荐),\n②该多级菜单可与其他多级菜单引用相同子项,\n请做出你的选择......
|
||||
|
||||
[MessageBox]
|
||||
@@ -242,10 +242,7 @@ CreateGroup = 新建一个分组
|
||||
[Other]
|
||||
RestartExplorer = 当前部分操作需要重启文件资源管理器生效
|
||||
DictionaryDescription = 字典说明
|
||||
LanguageDictionary = 程序语言
|
||||
GuidInfosDictionary = GUID信息
|
||||
ThridRulesDictionary = 三方规则
|
||||
CommonItemsDictionary = 常用菜单
|
||||
Translators = 翻译贡献者
|
||||
OtherLanguages = 下载或上传其他语言文件
|
||||
DonationList = 捐赠名单
|
||||
|
||||
Reference in New Issue
Block a user