Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
Expand Down Expand Up @@ -46,9 +46,9 @@

###############################################################################
# diff behavior for common document formats
#
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dotnet.preferCSharpExtension": true,
"githubPullRequests.ignoredPullRequestBranches": [
"master"
]
}
2 changes: 1 addition & 1 deletion ContextMenuManager/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<runtime>
<legacyCorruptedStateExceptionsPolicy enabled="true"/>
Expand Down
2 changes: 1 addition & 1 deletion ContextMenuManager/BluePointLilac.Controls/MyMainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected override void WndProc(ref Message m)
//解决控件过多调整窗体大小时延迟问题
case SC_SIZE:
suspend = this.SuspendMainBodyWhenMove; break;
//解决控件过多最大化最小化还原重绘卡顿问题
//解决控件过多最大化, 最小化, 还原重绘卡顿问题
case SC_RESTORE:
case SC_MINIMIZE:
case SC_MAXIMIZE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace BluePointLilac.Controls
{
/// <summary>限制水平竖直方向调整大小的窗体</summary>
/// <summary>限制水平, 竖直方向调整大小的窗体</summary>
public class ResizeLimitedForm : Form
{
/// <summary>水平方向可调整大小</summary>
Expand Down Expand Up @@ -38,7 +38,7 @@ protected override void WndProc(ref Message m)
}
}

const int WM_NCHITTEST = 0x84;//光标移动或鼠标按下释放时的消息
const int WM_NCHITTEST = 0x84;//光标移动或鼠标按下, 释放时的消息
/// <summary>鼠标击中位置</summary>
enum HitTest : int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace BluePointLilac.Methods
/// 代码用途:管理员UAC进程窗口拖放文件
/// 代码来源1:https://zhuanlan.zhihu.com/p/48735364
/// 代码来源2:https://github.com/volschin/sdimager/blob/master/ElevatedDragDropManager.cs
/// 代码作者:雨少主(知乎)volschin(Github)蓝点lilac(转载修改)
/// 代码作者:雨少主(知乎), volschin(Github), 蓝点lilac(转载, 修改)
/// 调用方法:var droper = new ElevatedFileDroper(control);
/// droper.DragDrop += (sender, e) => MessageBox.Show(droper.DropFilePaths[0]);
/// 备注:此类只能生效一个实例,不能将control.AllowDrop设为true,droper.DragDrop与control.DragDrop不共存
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void JumpRegEdit(string regPath, string valueName = null, bool mor
//还有一种方法,修改HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit
//中的LastKey键值(记录上次关闭注册表编辑器时的注册表路径)为要跳转的注册表项路径regPath,
//再使用Process.Start("regedit.exe", "-m")打开注册表编辑器
//优点:代码少不会有Bug。缺点:不能定位具体键,没有逐步展开效果
//优点:代码少, 不会有Bug。缺点:不能定位具体键,没有逐步展开效果
if(regPath == null) return;
Process process;
IntPtr hMain = FindWindow("RegEdit_RegEdit", null);
Expand Down
2 changes: 1 addition & 1 deletion ContextMenuManager/BluePointLilac.Methods/HighDpi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace BluePointLilac.Methods
/// <summary>处理不同DPI缩放比下的像素绘制和字体显示问题</summary>
/// <remarks>使用此类需要添加引用 PresentationFramework
/// 还应在配置清单App.manifest中启用DPI感知自动缩放
/// Font为矢量类型,PointSizeRectanglePadding等为像素类型。
/// Font为矢量类型,Point, Size, Rectangle, Padding等为像素类型。
/// 在不同DPI缩放下,矢量类型等比缩放,像素类型保持不变,故会出现排版显示问题。
/// 解决方案一:项目中所有用到的像素类型实例值都取与缩放比之积,矢量类型不变。
/// 解决方案二:项目中所有用到的矢量类型实例都取与缩放比之商,像素类型不变</remarks>
Expand Down
2 changes: 1 addition & 1 deletion ContextMenuManager/BluePointLilac.Methods/MessageBoxEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ protected override void OnLoad(EventArgs e)

public static class MessageBoxImage
{
// SystemIcons 里面的图标不是扁平的,❌、⚠️、❔、ℹ️
// SystemIcons 里面的图标不是扁平的,❌, ⚠️, ❔, ℹ️
public static readonly Image Error = GetImage(-98);
public static readonly Image Warning = GetImage(-84);
public static readonly Image Question = GetImage(-99);
Expand Down
10 changes: 5 additions & 5 deletions ContextMenuManager/BluePointLilac.Methods/RegTrustedInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace BluePointLilac.Methods
{
/// 获取TrustedInstaller权限注册表项的所有权
/// 代码作者:JPBlanc(原作者)蓝点lilac(转载修改)
/// 代码作者:JPBlanc(原作者), 蓝点lilac(转载, 修改)
/// 代码原文:https://gist.github.com/JPBlanc/ca0e4f1830e4ca18a526#file-write_a_registry_own_by_trustedinstaller-cs
public class RegTrustedInstaller
{
Expand Down Expand Up @@ -70,7 +70,7 @@ public enum TokenAccessRights
AdjustPrivileges = 32,
/// <summary>调整访问令牌中的组属性的权限.</summary>
AdjustGroups = 64,
/// <summary>更改访问令牌的默认所有者主组或DACL的权限.</summary>
/// <summary>更改访问令牌的默认所有者, 主组或DACL的权限.</summary>
AdjustDefault = 128,
/// <summary>正确调整访问令牌的会话ID.</summary>
AdjustSessionId = 256,
Expand Down Expand Up @@ -198,7 +198,7 @@ public static void TakeRegKeyOwnerShip(string regPath)
security.AddAccessRule(fullAccess);
key.SetAccessControl(security);

//注册表操作(写入删除)
//注册表操作(写入, 删除)
//key.SetValue("temp", "");//示例

//恢复原有所有者
Expand All @@ -209,7 +209,7 @@ public static void TakeRegKeyOwnerShip(string regPath)
//security.RemoveAccessRule(fullAccess);
//key.SetAccessControl(security);

///得到真正所有者注册表操作恢复原有所有者收回原有权利,这四部分在原文中没有被注释掉
///得到真正所有者, 注册表操作, 恢复原有所有者, 收回原有权利,这四部分在原文中没有被注释掉
///但是如果保留这四部分,会在恢复原有所有者这一步抛出异常,提示没有权限,
///不过我发现经过上面的操作,虽然无法还原所有者权限,但是已经获取了注册表权限
///即已经将TrustedInstaller权限更改为当前管理员用户权限,我要的目的已经达到了
Expand All @@ -219,7 +219,7 @@ public static void TakeRegKeyOwnerShip(string regPath)
finally { key?.Close(); id?.Dispose(); }
}

/// <summary>获取注册表项及其子项递归子级子项权限</summary>
/// <summary>获取注册表项及其子项, 递归子级子项权限</summary>
/// <remarks>将注册表项所有者改为当前管理员用户</remarks>
/// <param name="regPath">要获取权限的注册表完整路径</param>
public static void TakeRegTreeOwnerShip(string regPath)
Expand Down
2 changes: 1 addition & 1 deletion ContextMenuManager/BluePointLilac.Methods/ResourceIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static Icon GetExtensionIcon(string extension)
return GetIcon(extension, flags);
}

/// <summary>获取文件夹磁盘驱动器的图标</summary>
/// <summary>获取文件夹, 磁盘驱动器的图标</summary>
/// <param name="folderPath">文件夹或磁盘驱动器路径</param>
/// <returns>获取到的图标</returns>
public static Icon GetFolderIcon(string folderPath)
Expand Down
2 changes: 1 addition & 1 deletion ContextMenuManager/Controls/ShellNewItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace ContextMenuManager.Controls
*
* 2.① [DefaultOpenMode]不能为空,[DefaultOpenModePath]必须存在
* ② 菜单文本也不可为空
* ③ ShellNew项中必须存在 NullFileDataFileNameDirectoryCommand 中的一个或多个键值
* ③ ShellNew项中必须存在 NullFile, Data, FileName, Directory, Command 中的一个或多个键值
* 以上三个条件缺一不可,否则菜单不成立
*
* 3.菜单名称取值优先级:
Expand Down
2 changes: 1 addition & 1 deletion ContextMenuManager/Methods/ObjectPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum PathType { File, Directory, Registry }
private static readonly List<string> IgnoreCommandParts = new List<string> { "", "%1", "%v" };

/// <summary>根据文件名获取完整的文件路径</summary>
/// <remarks>fileName为Win+R注册表等可直接使用的文件名</remarks>
/// <remarks>fileName为Win+R, 注册表等可直接使用的文件名</remarks>
/// <param name="fileName">文件名</param>
/// <returns>成功提取返回true, fullPath为现有文件路径; 否则返回false, fullPath为null</returns>
public static bool GetFullFilePath(string fileName, out string fullPath)
Expand Down
2 changes: 1 addition & 1 deletion ContextMenuManager/Methods/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private static void UpdateApp(bool isManual)
XmlNode bodyXN = root.SelectSingleNode("body");
string info = AppString.Message.UpdateInfo.Replace("%v1", appVer.ToString()).Replace("%v2", webVer.ToString());
info += "\r\n\r\n" + MachinedInfo(bodyXN.InnerText);
if(MessageBox.Show(info, AppString.General.AppName,
if(MessageBox.Show(info, AppString.General.AppName,
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
string netVer = Environment.Version > new Version(4, 0) ? "4.0" : "3.5";
Expand Down
Loading