Skip to content

Commit

Permalink
Finish develop ContextMenuManager page
Browse files Browse the repository at this point in the history
1.Finish develop ContextMenuManager page
2.Fix Loopbackmanager page search filter error
3.Update readme.md
4.Publish 3.4.1210.0 version
  • Loading branch information
Gaoyifei1011 committed Dec 10, 2024
1 parent b217ef6 commit 31403c3
Show file tree
Hide file tree
Showing 27 changed files with 651 additions and 79 deletions.
2 changes: 1 addition & 1 deletion Description/README_EN-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ A toolbox that integrates multiple gadgets.
| Extract the package resource index(.pri) file conten | Finished |
| Color picker | Unfinished |
| Customize the right-click menu | Finished |
| Right-click menu items manager | Unfinished |
| Right-click menu items manager | Finished |
| System information | Unfinished |
| Driver manager | Unfinished |
| Update manager | Unfinished |
Expand Down
2 changes: 1 addition & 1 deletion Description/README_ZH-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
| 提取包资源文件索引内容 | 已完成 |
| 颜色选择器 | 未完成 |
| 自定义右键菜单 | 已完成 |
| 右键菜单项管理 | 未完成 |
| 右键菜单项管理 | 已完成 |
| 系统信息 | 未完成 |
| 驱动管理 | 未完成 |
| 更新管理 | 未完成 |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
| 提取包资源文件索引内容 | 已完成 |
| 颜色选择器 | 未完成 |
| 自定义右键菜单 | 已完成 |
| 右键菜单项管理 | 未完成 |
| 右键菜单项管理 | 已完成 |
| 系统信息 | 未完成 |
| 驱动管理 | 未完成 |
| 更新管理 | 未完成 |
Expand Down
5 changes: 3 additions & 2 deletions WindowsTools/Extensions/DataType/Enums/BlockedClsidType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{
public enum BlockedClsidType
{
CurrentUser,
LocalMachine
Unknown = 0,
CurrentUser = 1,
LocalMachine = 2
}
}
3 changes: 2 additions & 1 deletion WindowsTools/Extensions/DataType/Enums/OperationKind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public enum OperationKind
MenuDarkThemeIconPathEmpty = 19,
MenuProgramPathEmpty = 20,
MenuMatchRuleEmpty = 21,
ShellMenuNeedToRefreshData = 22
ShellMenuNeedToRefreshData = 22,
ContextMenuUpdate = 23
}
}
3 changes: 3 additions & 0 deletions WindowsTools/Models/ContextMenuItemModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.ComponentModel;
using System.Threading;
using WindowsTools.Extensions.DataType.Enums;

namespace WindowsTools.Models
{
Expand Down Expand Up @@ -31,6 +32,8 @@ public bool IsEnabled

public ApartmentState ThreadingMode { get; set; }

public BlockedClsidType BlockedClsidType { get; set; }

public event PropertyChangedEventHandler PropertyChanged;
}
}
5 changes: 4 additions & 1 deletion WindowsTools/Models/ContextMenuModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.ObjectModel;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
Expand Down Expand Up @@ -28,6 +29,8 @@ public Visibility IsVisible

public ImageSource PackageIcon { get; set; }

public Uri PackageIconUri { get; set; }

public string PackageDisplayName { get; set; }

public string PackageFullName { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions WindowsTools/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
[assembly: AssemblyCompany("高怡飞")]
[assembly: AssemblyCopyright("Copyright ©2024 高怡飞, All Rights Reserved.")]
[assembly: AssemblyDescription("Windows 工具箱")]
[assembly: AssemblyFileVersion("3.3.1208.0")]
[assembly: AssemblyInformationalVersion("3.3.1208.0")]
[assembly: AssemblyFileVersion("3.4.1210.0")]
[assembly: AssemblyInformationalVersion("3.4.1210.0")]
[assembly: AssemblyProduct("Windows 工具箱")]
[assembly: AssemblyTitle("Windows 工具箱")]
[assembly: AssemblyVersion("3.3.1208.0")]
[assembly: AssemblyVersion("3.4.1210.0")]

// 应用程序默认区域性的资源控制器设置
[assembly: NeutralResourcesLanguage("en-us")]
14 changes: 11 additions & 3 deletions WindowsTools/Strings/ContextMenuManager.en-us.restext
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
Title=Context menu manager
EmptyDescription=The device does not have any new right-click menu items
ExplainTitle=Menu management instructions
ExplanContent=Manage the display status of Windows new-click right-click menu items
ExplanContent1=1.Manage the display status of Windows new-click right-click menu items
ExplanContent2=2.Context menu item information is saved under registry HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\PackagedCom\\Package
ExplanContent3=3.The right-click menu item display status blacklist is saved in the registry under HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Blocked (no Blocked entries need to be created manually)
ExplanContent4=4.You can manually navigate to the corresponding registry key and add the key value of the right-click menu item to change the display status of the menu item
ExplanContent5=5.If you're not clear about the specific menu item you've changed, you can try reverting to the default settings, or removing the Blocked item
ExplanContent6=6.This app's right-click menu displays status options is in the settings page
LearnContextMenuManager=Learn right-click menu management
LearnCustomRightClickMenu=Learn about customizing the right-click menu
LearnCustomRightClickMenu=Learn to custom right-click menu
LoadingContextMenuInformation=Loading right-click menu information, please wait...
OpenPackagePathToolTip=Open the app installation folder
OpenSettings=Open settings
Refresh=Refresh
SearchAppNamePHText=Search app name
RestoreDefault=Restore default
SearchAppNamePHText=Search app name or package full name
SearchEmptyDescription=No matching right-click menu item found
SelectedToolTip=Selected
Unknown=Unknown
UnSelectedToolTip=Unselected
14 changes: 11 additions & 3 deletions WindowsTools/Strings/ContextMenuManager.restext
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
Title=Context menu manager
EmptyDescription=The device does not have any new right-click menu items
ExplainTitle=Menu management instructions
ExplanContent=Manage the display status of Windows new-click right-click menu items
ExplanContent1=1.Manage the display status of Windows new-click right-click menu items
ExplanContent2=2.Context menu item information is saved under registry HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\PackagedCom\\Package
ExplanContent3=3.The right-click menu item display status blacklist is saved in the registry under HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Blocked (no Blocked entries need to be created manually)
ExplanContent4=4.You can manually navigate to the corresponding registry key and add the key value of the right-click menu item to change the display status of the menu item
ExplanContent5=5.If you're not clear about the specific menu item you've changed, you can try reverting to the default settings, or removing the Blocked item
ExplanContent6=6.This app's right-click menu displays status options is in the settings page
LearnContextMenuManager=Learn right-click menu management
LearnCustomRightClickMenu=Learn about customizing the right-click menu
LearnCustomRightClickMenu=Learn to custom right-click menu
LoadingContextMenuInformation=Loading right-click menu information, please wait...
OpenPackagePathToolTip=Open the app installation folder
OpenSettings=Open settings
Refresh=Refresh
SearchAppNamePHText=Search app name
RestoreDefault=Restore default
SearchAppNamePHText=Search app name or package full name
SearchEmptyDescription=No matching right-click menu item found
SelectedToolTip=Selected
Unknown=Unknown
UnSelectedToolTip=Unselected
12 changes: 10 additions & 2 deletions WindowsTools/Strings/ContextMenuManager.zh-hans.restext
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
Title=右键菜单管理
EmptyDescription=该设备没有任何新版的右键菜单项
ExplainTitle=菜单管理说明
ExplanContent=管理 Windows 新版右键菜单项的显示状态
ExplanContent1=1.管理 Windows 新版右键菜单项的显示状态
ExplanContent2=2.右键菜单项信息保存在注册表 HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\PackagedCom\\Package 下
ExplanContent3=3.右键菜单项显示状态黑名单保存在注册表 HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Blocked 下(没有 Blocked 项需要手动创建)
ExplanContent4=4.您可以手动定位到所对应的注册表项,添加对应右键菜单项的键值以更改菜单项的显示状态
ExplanContent5=5.如果您不清楚您更改的具体菜单项,您可以尝试恢复默认设置,或删除 Blocked 项
ExplanContent6=6.本应用的右键菜单显示状态选项在设置页面
LearnContextMenuManager=了解右键菜单管理
LearnCustomRightClickMenu=了解自定义右键菜单
LoadingContextMenuInformation=正在加载右键菜单信息中,请稍候...
OpenPackagePathToolTip=打开应用安装目录
OpenSettings=打开设置
Refresh=刷新
SearchAppNamePHText=搜索应用名称
RestoreDefault=恢复默认
SearchAppNamePHText=搜索应用名称或包全名
SearchEmptyDescription=没有搜索到复合的右键菜单项
SelectedToolTip=已选择
Unknown=未知
UnSelectedToolTip=未选择
1 change: 0 additions & 1 deletion WindowsTools/Strings/Dialog.en-us.restext
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ Operation=Operation
OperationFailed=Error message list
Restart=Application restart
RestartContent=The app is about to restart, after the restart the app's data will be lost, make sure that your work has been saved in its entirety
WindowsAppSDKVersion=Windows App SDK version:
WindowsUIVersion=Windows UI version:
WinUI2Version=WinUI 2 Version:
1 change: 0 additions & 1 deletion WindowsTools/Strings/Dialog.restext
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ Operation=Operation
OperationFailed=Error message list
Restart=Application restart
RestartContent=The app is about to restart, after the restart the app's data will be lost, make sure that your work has been saved in its entirety
WindowsAppSDKVersion=Windows App SDK version:
WindowsUIVersion=Windows UI version:
WinUI2Version=WinUI 2 Version:
3 changes: 1 addition & 2 deletions WindowsTools/Strings/Dialog.zh-hans.restext
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ OpenFolder=打开文件夹
Operation=操作
OperationFailed=错误信息列表
Restart=重启应用
RestartContent=应用即将重启,重启后应用的数据将会丢失,请确保您的工作内容已经全部保存。
WindowsAppSDKVersion=Windows 应用 SDK 版本:
RestartContent=应用即将重启,重启后应用的数据将会丢失,请确保您的工作内容已经全部保存
WindowsUIVersion=Windows UI 版本:
WinUI2Version=WinUI 2 版本:
2 changes: 2 additions & 0 deletions WindowsTools/Strings/Notification.en-us.restext
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
AppInformationCopy=The app information was successfully copied to the clipboard
ContextMenuUpdateFailed=Right-click menu item status update failed, please manually update the value
ContextMenuUpdateSuccessfully=Right-click menu item status update successfully
CopyToClipboardFailed=Failed to copy the content to the clipboard. Please check the access permission of the clipboard
DesktopShortcutSuccessfully=The desktop shortcut for the app was created successfully
DesktopShortFailed=The app's desktop shortcut failed to create, please create it manually
Expand Down
2 changes: 2 additions & 0 deletions WindowsTools/Strings/Notification.restext
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
AppInformationCopy=The app information was successfully copied to the clipboard
ContextMenuUpdateFailed=Right-click menu item status update failed, please manually update the value
ContextMenuUpdateSuccessfully=Right-click menu item status update successfully
CopyToClipboardFailed=Failed to copy the content to the clipboard. Please check the access permission of the clipboard
DesktopShortcutSuccessfully=The desktop shortcut for the app was created successfully
DesktopShortFailed=The app's desktop shortcut failed to create, please create it manually
Expand Down
2 changes: 2 additions & 0 deletions WindowsTools/Strings/Notification.zh-hans.restext
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
AppInformationCopy=应用信息信息已成功复制到剪贴板
ContextMenuUpdateFailed=右键菜单项显示状态更新失败,请手动更新值
ContextMenuUpdateSuccessfully=右键菜单项显示状态更新成功
CopyToClipboardFailed=复制内容到剪贴板失败,请检查剪贴板的访问权限
DesktopShortcutSuccessfully=应用的桌面快捷方式已成功创建
DesktopShortFailed=应用的桌面快捷方式创建失败,请手动创建
Expand Down
14 changes: 2 additions & 12 deletions WindowsTools/UI/Dialogs/AppInformationDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,18 @@ await Task.Run(() =>
byte[] buffer = new byte[bufferLength];
KernelAppCoreLibrary.GetCurrentPackageInfo2(PACKAGE_FLAGS.PACKAGE_PROPERTY_STATIC, PackagePathType.PackagePathType_Install, ref bufferLength, buffer, out count);

for (int i = 0; i < count; i++)
for (int index = 0; index < count; index++)
{
int packageInfoSize = Marshal.SizeOf<PACKAGE_INFO>();
IntPtr packageInfoPtr = Marshal.AllocHGlobal(packageInfoSize);
Marshal.Copy(buffer, i * packageInfoSize, packageInfoPtr, packageInfoSize);
Marshal.Copy(buffer, index * packageInfoSize, packageInfoPtr, packageInfoSize);
PACKAGE_INFO packageInfo = Marshal.PtrToStructure<PACKAGE_INFO>(packageInfoPtr);
packageInfoList.Add(packageInfo);
Marshal.FreeHGlobal(packageInfoPtr);
}

foreach (PACKAGE_INFO packageInfo in packageInfoList)
{
if (packageInfo.packageFullName.Contains("WindowsAppRuntime"))
{
// Windows 应用 SDK 版本信息
dependencyInformationList.Add(new KeyValuePair<string, Version>(ResourceService.DialogResource.GetString("WindowsAppSDKVersion"), new Version(
packageInfo.packageId.version.Parts.Major,
packageInfo.packageId.version.Parts.Minor,
packageInfo.packageId.version.Parts.Build,
packageInfo.packageId.version.Parts.Revision)));
}

// WinUI 2 版本信息
if (packageInfo.packageFullName.Contains("Microsoft.UI.Xaml"))
{
Expand Down
15 changes: 15 additions & 0 deletions WindowsTools/UI/TeachingTips/OperationResultTip.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,21 @@ public OperationResultTip(OperationKind operationKind, bool operationResult)
OperationResultFailed.Visibility = Visibility.Visible;
}
}
else if (operationKind is OperationKind.ContextMenuUpdate)
{
if (operationResult)
{
OperationResultSuccess.Text = ResourceService.NotificationResource.GetString("ContextMenuUpdateSuccessfully");
OperationResultSuccess.Visibility = Visibility.Visible;
OperationResultFailed.Visibility = Visibility.Collapsed;
}
else
{
OperationResultFailed.Text = ResourceService.NotificationResource.GetString("ContextMenuUpdateFailed");
OperationResultSuccess.Visibility = Visibility.Collapsed;
OperationResultFailed.Visibility = Visibility.Visible;
}
}
}

public OperationResultTip(OperationKind operationKind, int successItems, int failedItems)
Expand Down
Loading

0 comments on commit 31403c3

Please sign in to comment.