mirror of
https://github.com/jie65535/KeyGo.git
synced 2025-12-15 18:41:38 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 077b8b1e13 | |||
| 7acb1d483d | |||
| a0ac2e988e | |||
|
|
d63d344e7b | ||
|
|
2ea8cbf725 | ||
|
|
01e218559a |
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 15 KiB |
71
KeyGo/AppConfig.cs
Normal file
71
KeyGo/AppConfig.cs
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace KeyGo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 应用配置帮助类
|
||||||
|
/// </summary>
|
||||||
|
public class AppConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether [power boot].
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// <c>true</c> if [power boot]; otherwise, <c>false</c>.
|
||||||
|
/// </value>
|
||||||
|
public bool PowerBoot { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether [close to hide].
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// <c>true</c> if [close to hide]; otherwise, <c>false</c>.
|
||||||
|
/// </value>
|
||||||
|
public bool CloseToHide { get; set; } = true;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loads the XML.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filePath">The file path.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static AppConfig LoadXml(string filePath)
|
||||||
|
{
|
||||||
|
AppConfig data = null;
|
||||||
|
if (File.Exists(filePath))
|
||||||
|
{
|
||||||
|
XmlSerializer formatter = new XmlSerializer(typeof(AppConfig));
|
||||||
|
using (var stream = File.OpenRead(filePath))
|
||||||
|
{
|
||||||
|
if (stream.Length > 0)
|
||||||
|
{
|
||||||
|
data = formatter.Deserialize(stream) as AppConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Saves the XML.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filePath">The file path.</param>
|
||||||
|
public void SaveXml(string filePath)
|
||||||
|
{
|
||||||
|
if (!File.Exists(filePath))
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(filePath));
|
||||||
|
|
||||||
|
XmlSerializer formatter = new XmlSerializer(typeof(AppConfig));
|
||||||
|
using (var stream = File.Create(filePath))
|
||||||
|
{
|
||||||
|
formatter.Serialize(stream, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -41,7 +41,7 @@ namespace KeyGo
|
|||||||
if (instance != null && instance.MainWindowHandle != IntPtr.Zero)
|
if (instance != null && instance.MainWindowHandle != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
if (IsIconic(instance.MainWindowHandle))
|
if (IsIconic(instance.MainWindowHandle))
|
||||||
ShowWindowAsync(instance.MainWindowHandle, (int)CmdShow.Restore);
|
ShowWindow(instance.MainWindowHandle, (int)CmdShow.Restore);
|
||||||
SetForegroundWindow(instance.MainWindowHandle);
|
SetForegroundWindow(instance.MainWindowHandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,9 +53,16 @@ namespace KeyGo
|
|||||||
public static void MinimizeWindow(Process instance)
|
public static void MinimizeWindow(Process instance)
|
||||||
{
|
{
|
||||||
if (instance != null && instance.MainWindowHandle != IntPtr.Zero)
|
if (instance != null && instance.MainWindowHandle != IntPtr.Zero)
|
||||||
ShowWindowAsync(instance.MainWindowHandle, (int)CmdShow.Minimize);
|
ShowWindow(instance.MainWindowHandle, (int)CmdShow.Minimize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether [is foreground window] [the specified instance].
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <returns>
|
||||||
|
/// <c>true</c> if [is foreground window] [the specified instance]; otherwise, <c>false</c>.
|
||||||
|
/// </returns>
|
||||||
public static bool IsForegroundWindow(Process instance)
|
public static bool IsForegroundWindow(Process instance)
|
||||||
{
|
{
|
||||||
return GetForegroundWindow() == instance.MainWindowHandle;
|
return GetForegroundWindow() == instance.MainWindowHandle;
|
||||||
@@ -143,10 +150,12 @@ namespace KeyGo
|
|||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("User32.dll")]
|
[DllImport("User32.dll")]
|
||||||
private static extern bool ShowWindowAsync(System.IntPtr hWnd, int cmdShow);
|
private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
|
||||||
|
[DllImport("User32.dll")]
|
||||||
|
private static extern bool ShowWindow(IntPtr hWnd, int cmdShow);
|
||||||
|
|
||||||
[DllImport("User32.dll")]
|
[DllImport("User32.dll")]
|
||||||
private static extern bool SetForegroundWindow(System.IntPtr hWnd);
|
private static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||||
|
|
||||||
[DllImport("User32.dll")]
|
[DllImport("User32.dll")]
|
||||||
private static extern IntPtr GetForegroundWindow();
|
private static extern IntPtr GetForegroundWindow();
|
||||||
|
|||||||
46
KeyGo/FormMain.Designer.cs
generated
46
KeyGo/FormMain.Designer.cs
generated
@@ -35,9 +35,9 @@ namespace KeyGo
|
|||||||
this.BtnAdd = new System.Windows.Forms.Button();
|
this.BtnAdd = new System.Windows.Forms.Button();
|
||||||
this.NotifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
this.NotifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
|
this.TSMICloseToHide = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.TSMIPowerBoot = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.TSMIExit = new System.Windows.Forms.ToolStripMenuItem();
|
this.TSMIExit = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.TSMIPowerOnStartup = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.TSMICloseToMin = new System.Windows.Forms.ToolStripMenuItem();
|
|
||||||
this.FLPHotKeys.SuspendLayout();
|
this.FLPHotKeys.SuspendLayout();
|
||||||
this.contextMenuStrip1.SuspendLayout();
|
this.contextMenuStrip1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
@@ -75,35 +75,35 @@ namespace KeyGo
|
|||||||
// contextMenuStrip1
|
// contextMenuStrip1
|
||||||
//
|
//
|
||||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.TSMICloseToMin,
|
this.TSMICloseToHide,
|
||||||
this.TSMIPowerOnStartup,
|
this.TSMIPowerBoot,
|
||||||
this.TSMIExit});
|
this.TSMIExit});
|
||||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||||
this.contextMenuStrip1.Size = new System.Drawing.Size(149, 70);
|
this.contextMenuStrip1.Size = new System.Drawing.Size(149, 70);
|
||||||
//
|
//
|
||||||
|
// TSMICloseToHide
|
||||||
|
//
|
||||||
|
this.TSMICloseToHide.CheckOnClick = true;
|
||||||
|
this.TSMICloseToHide.Name = "TSMICloseToHide";
|
||||||
|
this.TSMICloseToHide.Size = new System.Drawing.Size(148, 22);
|
||||||
|
this.TSMICloseToHide.Text = "关闭为最小化";
|
||||||
|
this.TSMICloseToHide.CheckedChanged += new System.EventHandler(this.TSMICloseToHide_CheckedChanged);
|
||||||
|
//
|
||||||
|
// TSMIPowerBoot
|
||||||
|
//
|
||||||
|
this.TSMIPowerBoot.CheckOnClick = true;
|
||||||
|
this.TSMIPowerBoot.Name = "TSMIPowerBoot";
|
||||||
|
this.TSMIPowerBoot.Size = new System.Drawing.Size(148, 22);
|
||||||
|
this.TSMIPowerBoot.Text = "开机自启动";
|
||||||
|
this.TSMIPowerBoot.CheckedChanged += new System.EventHandler(this.TSMIPowerBoot_CheckedChanged);
|
||||||
|
//
|
||||||
// TSMIExit
|
// TSMIExit
|
||||||
//
|
//
|
||||||
this.TSMIExit.Name = "TSMIExit";
|
this.TSMIExit.Name = "TSMIExit";
|
||||||
this.TSMIExit.Size = new System.Drawing.Size(180, 22);
|
this.TSMIExit.Size = new System.Drawing.Size(148, 22);
|
||||||
this.TSMIExit.Text = "退出";
|
this.TSMIExit.Text = "退出";
|
||||||
this.TSMIExit.Click += new System.EventHandler(this.TSMIExit_Click);
|
this.TSMIExit.Click += new System.EventHandler(this.TSMIExit_Click);
|
||||||
//
|
//
|
||||||
// TSMIPowerOnStartup
|
|
||||||
//
|
|
||||||
this.TSMIPowerOnStartup.CheckOnClick = true;
|
|
||||||
this.TSMIPowerOnStartup.Name = "TSMIPowerOnStartup";
|
|
||||||
this.TSMIPowerOnStartup.Size = new System.Drawing.Size(180, 22);
|
|
||||||
this.TSMIPowerOnStartup.Text = "开机自启动";
|
|
||||||
this.TSMIPowerOnStartup.CheckedChanged += new System.EventHandler(this.TSMIPowerOnStartup_CheckedChanged);
|
|
||||||
//
|
|
||||||
// TSMICloseToMin
|
|
||||||
//
|
|
||||||
this.TSMICloseToMin.CheckOnClick = true;
|
|
||||||
this.TSMICloseToMin.Name = "TSMICloseToMin";
|
|
||||||
this.TSMICloseToMin.Size = new System.Drawing.Size(180, 22);
|
|
||||||
this.TSMICloseToMin.Text = "关闭为最小化";
|
|
||||||
this.TSMICloseToMin.CheckedChanged += new System.EventHandler(this.TSMICloseToMin_CheckedChanged);
|
|
||||||
//
|
|
||||||
// FormMain
|
// FormMain
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
|
||||||
@@ -135,8 +135,8 @@ namespace KeyGo
|
|||||||
private System.Windows.Forms.NotifyIcon NotifyIcon;
|
private System.Windows.Forms.NotifyIcon NotifyIcon;
|
||||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem TSMIExit;
|
private System.Windows.Forms.ToolStripMenuItem TSMIExit;
|
||||||
private System.Windows.Forms.ToolStripMenuItem TSMIPowerOnStartup;
|
private System.Windows.Forms.ToolStripMenuItem TSMIPowerBoot;
|
||||||
private System.Windows.Forms.ToolStripMenuItem TSMICloseToMin;
|
private System.Windows.Forms.ToolStripMenuItem TSMICloseToHide;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,39 +4,79 @@ using System.IO;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace KeyGo
|
namespace KeyGo
|
||||||
{
|
{
|
||||||
public partial class FormMain : Form
|
public partial class FormMain : Form
|
||||||
{
|
{
|
||||||
private static readonly string _DataFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "KeyGo", "HotKey.xml");
|
#region 成员
|
||||||
|
|
||||||
|
private static readonly string _DataFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "KeyGo");
|
||||||
|
private static readonly string _DataFilePath = Path.Combine(_DataFolderPath, "HotKey.xml");
|
||||||
|
private static readonly string _AppConfigFilePath = Path.Combine(_DataFolderPath, "AppConfig.xml");
|
||||||
private readonly KeyGo _KeyGo;
|
private readonly KeyGo _KeyGo;
|
||||||
|
private readonly AppConfig _AppConfig;
|
||||||
|
private readonly string _CurrentProcessName;
|
||||||
|
private bool _Initializing;
|
||||||
|
|
||||||
|
#endregion 成员
|
||||||
|
|
||||||
|
#region 构造
|
||||||
|
|
||||||
public FormMain()
|
public FormMain()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
_Initializing = true;
|
||||||
|
|
||||||
|
// 读取程序集版本,显示到标题栏
|
||||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||||
AssemblyName thisAssemName = assembly.GetName();
|
AssemblyName thisAssemName = assembly.GetName();
|
||||||
Text += $" - {thisAssemName.Version}";
|
Text += $" - {thisAssemName.Version} - github.com/jie65535/KeyGo";
|
||||||
|
|
||||||
|
// 载入并初始化配置
|
||||||
|
_AppConfig = LoadAppConfig(_AppConfigFilePath);
|
||||||
|
TSMICloseToHide.Checked = _AppConfig.CloseToHide;
|
||||||
|
TSMIPowerBoot.Checked = _AppConfig.PowerBoot;
|
||||||
|
SetPowerBoot(_AppConfig.PowerBoot);
|
||||||
|
|
||||||
|
// 载入热键数据
|
||||||
_KeyGo = LoadHotKeyItems(_DataFilePath);
|
_KeyGo = LoadHotKeyItems(_DataFilePath);
|
||||||
|
_KeyGo.HotKeyTriggerEvent += KeyGo_HotKeyTriggerEvent;
|
||||||
_KeyGo.FormHandle = Handle;
|
_KeyGo.FormHandle = Handle;
|
||||||
var p = Process.GetCurrentProcess();
|
var p = Process.GetCurrentProcess();
|
||||||
|
_CurrentProcessName = p.ProcessName;
|
||||||
if (_KeyGo.Items.Count == 0)
|
if (_KeyGo.Items.Count == 0)
|
||||||
{
|
{
|
||||||
_KeyGo.Items.Add(new HotKeyItem
|
_KeyGo.Items.Add(new HotKeyItem
|
||||||
{
|
{
|
||||||
ProcessName = p.ProcessName,
|
ProcessName = _CurrentProcessName,
|
||||||
StartupPath = p.MainModule.FileName,
|
StartupPath = p.MainModule.FileName,
|
||||||
HotKey = "Ctrl+G",
|
HotKey = "Ctrl+G",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_KeyGo.RegAllKey();
|
_KeyGo.RegAllKey();
|
||||||
|
|
||||||
|
// 初始化UI
|
||||||
FLPHotKeys.SuspendLayout();
|
FLPHotKeys.SuspendLayout();
|
||||||
foreach (var item in _KeyGo.Items)
|
foreach (var item in _KeyGo.Items)
|
||||||
FLP_AddItem(item);
|
FLP_AddItem(item);
|
||||||
FLPHotKeys.ResumeLayout();
|
FLPHotKeys.ResumeLayout();
|
||||||
|
|
||||||
|
_Initializing = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion 构造
|
||||||
|
|
||||||
|
#region 窗体事件
|
||||||
|
|
||||||
|
private void KeyGo_HotKeyTriggerEvent(object sender, HotKeyTriggerEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.HotKeyItem.ProcessName == _CurrentProcessName)
|
||||||
|
{
|
||||||
|
ChangeVisible();
|
||||||
|
e.Handle = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FormMain_Load(object sender, EventArgs e)
|
private void FormMain_Load(object sender, EventArgs e)
|
||||||
@@ -44,22 +84,32 @@ namespace KeyGo
|
|||||||
Console.WriteLine(_DataFilePath);
|
Console.WriteLine(_DataFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isExit;
|
private bool isExit;
|
||||||
|
|
||||||
private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
|
private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
if (!isExit)
|
if (!isExit && _AppConfig.CloseToHide)
|
||||||
{
|
{
|
||||||
Hide();
|
Hide();
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void FormMain_Deactivate(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// 如果最小化,则隐藏窗体
|
||||||
|
if (WindowState == FormWindowState.Minimized)
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
|
||||||
private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
|
private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
|
||||||
{
|
{
|
||||||
_KeyGo.UnRegAllKey();
|
_KeyGo.UnRegAllKey();
|
||||||
SaveHotKeyItems(_KeyGo);
|
SaveHotKeyItems(_KeyGo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion 窗体事件
|
||||||
|
|
||||||
#region 数据文件IO
|
#region 数据文件IO
|
||||||
|
|
||||||
private KeyGo LoadHotKeyItems(string xmlFilePath)
|
private KeyGo LoadHotKeyItems(string xmlFilePath)
|
||||||
@@ -90,6 +140,36 @@ namespace KeyGo
|
|||||||
|
|
||||||
#endregion 数据文件IO
|
#endregion 数据文件IO
|
||||||
|
|
||||||
|
#region 配置文件IO
|
||||||
|
|
||||||
|
private AppConfig LoadAppConfig(string xmlFilePath)
|
||||||
|
{
|
||||||
|
AppConfig instance = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
instance = AppConfig.LoadXml(xmlFilePath);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("载入配置文件异常:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
return instance ?? new AppConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SaveAppConfig(AppConfig config)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
config.SaveXml(_AppConfigFilePath);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("保存配置文件异常:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion 配置文件IO
|
||||||
|
|
||||||
#region 窗体消息 热键回调
|
#region 窗体消息 热键回调
|
||||||
|
|
||||||
private const int WM_HOTKEY = 0x312;
|
private const int WM_HOTKEY = 0x312;
|
||||||
@@ -107,21 +187,7 @@ namespace KeyGo
|
|||||||
|
|
||||||
#endregion 窗体消息 热键回调
|
#endregion 窗体消息 热键回调
|
||||||
|
|
||||||
private void BtnTest_Click(object sender, EventArgs e)
|
#region 热键管理
|
||||||
{
|
|
||||||
//_KeyGo.Items.Add(new HotKeyItem
|
|
||||||
//{
|
|
||||||
// ProcessName = "QQ",
|
|
||||||
// StartupPath = "",
|
|
||||||
// HotKey = "Ctrl+Q",
|
|
||||||
// Enabled = true,
|
|
||||||
// TriggerCounter = 0,
|
|
||||||
// CreationTime = DateTime.Now,
|
|
||||||
// LastModifiedTime = DateTime.Now,
|
|
||||||
//});
|
|
||||||
//SaveHotKeyItems(_KeyGo);
|
|
||||||
//new FormHotKey().ShowDialog();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnAdd_Click(object sender, EventArgs e)
|
private void BtnAdd_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -162,12 +228,21 @@ namespace KeyGo
|
|||||||
FLPHotKeys.Controls.SetChildIndex(BtnAdd, i1);
|
FLPHotKeys.Controls.SetChildIndex(BtnAdd, i1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion 热键管理
|
||||||
|
|
||||||
|
#region 托盘图标管理
|
||||||
|
|
||||||
private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
|
private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
// 鼠标左键点击托盘图标才触发
|
// 鼠标左键点击托盘图标才触发
|
||||||
if (e.Button != MouseButtons.Left)
|
if (e.Button != MouseButtons.Left)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ChangeVisible();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeVisible()
|
||||||
|
{
|
||||||
// 当前在前台则隐藏
|
// 当前在前台则隐藏
|
||||||
if (Visible)
|
if (Visible)
|
||||||
{
|
{
|
||||||
@@ -192,27 +267,64 @@ namespace KeyGo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FormMain_Deactivate(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// 如果最小化,则隐藏窗体
|
|
||||||
if (WindowState == FormWindowState.Minimized)
|
|
||||||
Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TSMIExit_Click(object sender, EventArgs e)
|
private void TSMIExit_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
isExit = true;
|
isExit = true;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TSMIPowerOnStartup_CheckedChanged(object sender, EventArgs e)
|
private void TSMIPowerBoot_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MessageBox.Show("暂未完成", "TODO");
|
if (_Initializing)
|
||||||
|
return;
|
||||||
|
_AppConfig.PowerBoot = TSMIPowerBoot.Checked;
|
||||||
|
SetPowerBoot(_AppConfig.PowerBoot);
|
||||||
|
SaveAppConfig(_AppConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TSMICloseToMin_CheckedChanged(object sender, EventArgs e)
|
private void TSMICloseToHide_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MessageBox.Show("暂未完成", "TODO");
|
if (_Initializing)
|
||||||
|
return;
|
||||||
|
_AppConfig.CloseToHide = TSMICloseToHide.Checked;
|
||||||
|
SaveAppConfig(_AppConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion 托盘图标管理
|
||||||
|
|
||||||
|
#region 开机自启动
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设置开机自启动
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="enable">if set to <c>true</c> [enable].</param>
|
||||||
|
private void SetPowerBoot(bool enable)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (enable)
|
||||||
|
{
|
||||||
|
RegistryKey R_local = Registry.CurrentUser;
|
||||||
|
RegistryKey R_run = R_local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
|
||||||
|
R_run.SetValue("KeyGo", Application.ExecutablePath);
|
||||||
|
R_run.Close();
|
||||||
|
R_local.Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RegistryKey R_local = Registry.CurrentUser;
|
||||||
|
RegistryKey R_run = R_local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
|
||||||
|
R_run.DeleteValue("KeyGo", false);
|
||||||
|
R_run.Close();
|
||||||
|
R_local.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("注册表编辑失败:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -9,15 +9,21 @@ using System.Xml.Serialization;
|
|||||||
|
|
||||||
namespace KeyGo
|
namespace KeyGo
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// KeyGo 核心功能类
|
||||||
|
/// </summary>
|
||||||
public class KeyGo
|
public class KeyGo
|
||||||
{
|
{
|
||||||
static int _RegMaxID;
|
#region Member
|
||||||
|
|
||||||
|
private static int _RegMaxID;
|
||||||
|
|
||||||
[XmlIgnore]
|
[XmlIgnore]
|
||||||
public IntPtr FormHandle { get; set; }
|
public IntPtr FormHandle { get; set; }
|
||||||
|
|
||||||
public List<HotKeyItem> Items { get; set; } = new List<HotKeyItem>();
|
public List<HotKeyItem> Items { get; set; } = new List<HotKeyItem>();
|
||||||
|
|
||||||
|
#endregion Member
|
||||||
|
|
||||||
#region FILE IO
|
#region FILE IO
|
||||||
|
|
||||||
@@ -59,7 +65,7 @@ namespace KeyGo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion FILE IO
|
||||||
|
|
||||||
#region HotKey Register
|
#region HotKey Register
|
||||||
|
|
||||||
@@ -84,7 +90,6 @@ namespace KeyGo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Uns the reg all key.
|
/// Uns the reg all key.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -140,15 +145,19 @@ namespace KeyGo
|
|||||||
case "ctrl":
|
case "ctrl":
|
||||||
keyModifiers |= AppHotKey.KeyModifiers.Ctrl;
|
keyModifiers |= AppHotKey.KeyModifiers.Ctrl;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "shift":
|
case "shift":
|
||||||
keyModifiers |= AppHotKey.KeyModifiers.Shift;
|
keyModifiers |= AppHotKey.KeyModifiers.Shift;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "alt":
|
case "alt":
|
||||||
keyModifiers |= AppHotKey.KeyModifiers.Alt;
|
keyModifiers |= AppHotKey.KeyModifiers.Alt;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "win":
|
case "win":
|
||||||
keyModifiers |= AppHotKey.KeyModifiers.WindowsKey;
|
keyModifiers |= AppHotKey.KeyModifiers.WindowsKey;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
keyCode = (Keys)Enum.Parse(typeof(Keys), key);
|
keyCode = (Keys)Enum.Parse(typeof(Keys), key);
|
||||||
break;
|
break;
|
||||||
@@ -180,7 +189,21 @@ namespace KeyGo
|
|||||||
item.HotKeyID = 0;
|
item.HotKeyID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion HotKey Register
|
||||||
|
|
||||||
|
#region HotKey Trigger
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 热键触发时调用
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<HotKeyTriggerEventArgs> HotKeyTriggerEvent;
|
||||||
|
|
||||||
|
private bool OnHotKeyTrigger(HotKeyItem item)
|
||||||
|
{
|
||||||
|
var args = new HotKeyTriggerEventArgs{ HotKeyItem = item };
|
||||||
|
HotKeyTriggerEvent?.Invoke(this, args);
|
||||||
|
return args.Handle;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes the hotkey.
|
/// Processes the hotkey.
|
||||||
@@ -191,15 +214,26 @@ namespace KeyGo
|
|||||||
var hotkey = Items.Find(k => k.HotKeyID == hotKey_id);
|
var hotkey = Items.Find(k => k.HotKeyID == hotKey_id);
|
||||||
if (hotkey != null)
|
if (hotkey != null)
|
||||||
{
|
{
|
||||||
|
//Console.WriteLine($"ID:{hotkey.HotKeyID} Keys:{hotkey.HotKey} ProcessName:{hotkey.ProcessName}\nStartupPath:{hotkey.StartupPath}");
|
||||||
++hotkey.TriggerCounter;
|
++hotkey.TriggerCounter;
|
||||||
|
// 触发事件,若被外部处理,则内部不再执行
|
||||||
|
if (OnHotKeyTrigger(hotkey))
|
||||||
|
return;
|
||||||
|
|
||||||
// 热键相应逻辑:
|
// 热键相应逻辑:
|
||||||
// 若应用未启动:启动应用
|
// 若应用未启动:启动应用
|
||||||
// 若应用未在最前:激活窗体,推到最前
|
// 若应用未在最前:激活窗体,推到最前
|
||||||
// 若应用已在最前:最小化窗体
|
// 若应用已在最前:最小化窗体
|
||||||
|
|
||||||
var process = Process.GetProcessesByName(hotkey.ProcessName).Where(p => p.MainWindowHandle != IntPtr.Zero).ToArray().FirstOrDefault();
|
var processes = Process.GetProcessesByName(hotkey.ProcessName);
|
||||||
|
if (processes == null || processes.Length < 1)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(hotkey.StartupPath) && File.Exists(hotkey.StartupPath))
|
||||||
|
Process.Start(hotkey.StartupPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var process = processes.Where(p => p.MainWindowHandle != IntPtr.Zero).ToArray().FirstOrDefault();
|
||||||
if (process != null)
|
if (process != null)
|
||||||
{
|
{
|
||||||
if (AppControl.IsForegroundWindow(process))
|
if (AppControl.IsForegroundWindow(process))
|
||||||
@@ -207,15 +241,13 @@ namespace KeyGo
|
|||||||
else
|
else
|
||||||
AppControl.ShowWindow(process);
|
AppControl.ShowWindow(process);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
if (!string.IsNullOrWhiteSpace(hotkey.StartupPath) && File.Exists(hotkey.StartupPath))
|
|
||||||
Process.Start(hotkey.StartupPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine($"ID:{hotkey.HotKeyID} Keys:{hotkey.HotKey} ProcessName:{hotkey.ProcessName}\nStartupPath:{hotkey.StartupPath}");
|
#endregion HotKey Trigger
|
||||||
}
|
|
||||||
}
|
#region HotKey Manager
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加一个新热键
|
/// 添加一个新热键
|
||||||
@@ -261,5 +293,23 @@ namespace KeyGo
|
|||||||
if (item.Enabled)
|
if (item.Enabled)
|
||||||
RegKey(item);
|
RegKey(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion HotKey Manager
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 热键触发事件参数
|
||||||
|
/// </summary>
|
||||||
|
public class HotKeyTriggerEventArgs
|
||||||
|
{
|
||||||
|
public HotKeyItem HotKeyItem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置该事件是否已经被处理
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// <c>true</c> if handle; otherwise, <c>false</c>.
|
||||||
|
/// </value>
|
||||||
|
public bool Handle { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,6 +55,15 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetZone>LocalIntranet</TargetZone>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<GenerateManifests>false</GenerateManifests>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
@@ -69,6 +78,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="AppConfig.cs" />
|
||||||
<Compile Include="AppControl.cs" />
|
<Compile Include="AppControl.cs" />
|
||||||
<Compile Include="AppHotKey.cs" />
|
<Compile Include="AppHotKey.cs" />
|
||||||
<Compile Include="FormHotKey.cs">
|
<Compile Include="FormHotKey.cs">
|
||||||
@@ -121,6 +131,7 @@
|
|||||||
<EmbeddedResource Include="UCHotKeyItem.resx">
|
<EmbeddedResource Include="UCHotKeyItem.resx">
|
||||||
<DependentUpon>UCHotKeyItem.cs</DependentUpon>
|
<DependentUpon>UCHotKeyItem.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<None Include="Properties\app.manifest" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace KeyGo
|
namespace KeyGo
|
||||||
@@ -14,14 +15,64 @@ namespace KeyGo
|
|||||||
var p = AppControl.GetCurrentRunningInstance();
|
var p = AppControl.GetCurrentRunningInstance();
|
||||||
if (p != null)
|
if (p != null)
|
||||||
{
|
{
|
||||||
|
if (p.MainWindowHandle == IntPtr.Zero)
|
||||||
|
MessageBox.Show("应用程序已启用或未关闭,请勿重复启动程序。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
else
|
||||||
AppControl.ShowWindow(p);
|
AppControl.ShowWindow(p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//设置应用程序处理异常方式:ThreadException处理
|
||||||
|
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
|
||||||
|
//处理UI线程异常
|
||||||
|
Application.ThreadException += Application_ThreadException;
|
||||||
|
//处理非UI线程异常
|
||||||
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new FormMain());
|
Application.Run(new FormMain());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
string str = GetExceptionMsg(e.Exception, e.ToString());
|
||||||
|
//Logger.Info("应用程序线程异常", e.Exception);
|
||||||
|
MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
|
||||||
|
//Logger.Info("未捕获异常", e.ExceptionObject as Exception);
|
||||||
|
MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生成自定义异常消息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="ex">异常对象</param>
|
||||||
|
/// <param name="backStr">备用异常消息:当ex为null时有效</param>
|
||||||
|
/// <returns>异常字符串文本</returns>
|
||||||
|
private static string GetExceptionMsg(Exception ex, string backStr)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.AppendLine("****************************异常文本****************************");
|
||||||
|
sb.AppendLine("【出现时间】:" + DateTime.Now.ToString());
|
||||||
|
if (ex != null)
|
||||||
|
{
|
||||||
|
sb.AppendLine("【异常类型】:" + ex.GetType().Name);
|
||||||
|
sb.AppendLine("【异常信息】:" + ex.Message);
|
||||||
|
#if DEBUG
|
||||||
|
sb.AppendLine("【堆栈调用】:" + ex.StackTrace);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sb.AppendLine("【未处理异常】:" + backStr);
|
||||||
|
}
|
||||||
|
sb.AppendLine("***************************************************************");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
|
|||||||
// 控制。更改这些特性值可修改
|
// 控制。更改这些特性值可修改
|
||||||
// 与程序集关联的信息。
|
// 与程序集关联的信息。
|
||||||
[assembly: AssemblyTitle("KeyGo")]
|
[assembly: AssemblyTitle("KeyGo")]
|
||||||
[assembly: AssemblyDescription("通过注册热键 启动/切换到/最小化 预设应用的小工具")]
|
[assembly: AssemblyDescription("通过注册热键 启动/切换到/最小化 预设应用的小工具 - 开源地址:https://github.com/jie65535/KeyGo")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("KeyGo")]
|
[assembly: AssemblyProduct("KeyGo")]
|
||||||
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
|||||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||||
//通过使用 "*",如下所示:
|
//通过使用 "*",如下所示:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.1.0.3")]
|
[assembly: AssemblyVersion("0.1.2")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
|||||||
69
KeyGo/Properties/app.manifest
Normal file
69
KeyGo/Properties/app.manifest
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<!-- UAC 清单选项
|
||||||
|
如果想要更改 Windows 用户帐户控制级别,请使用
|
||||||
|
以下节点之一替换 requestedExecutionLevel 节点。n
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||||
|
|
||||||
|
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
|
||||||
|
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
|
||||||
|
元素。
|
||||||
|
-->
|
||||||
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||||
|
</requestedPrivileges>
|
||||||
|
<applicationRequestMinimum>
|
||||||
|
<defaultAssemblyRequest permissionSetReference="Custom" />
|
||||||
|
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
|
||||||
|
</applicationRequestMinimum>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
|
||||||
|
Windows 版本的列表。取消评论适当的元素,
|
||||||
|
Windows 将自动选择最兼容的环境。 -->
|
||||||
|
<!-- Windows Vista -->
|
||||||
|
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
|
||||||
|
<!-- Windows 8 -->
|
||||||
|
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
<!-- 指示该应用程序可以感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
|
||||||
|
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
|
||||||
|
选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应
|
||||||
|
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。-->
|
||||||
|
<!--
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<windowsSettings>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||||
|
</windowsSettings>
|
||||||
|
</application>
|
||||||
|
-->
|
||||||
|
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity
|
||||||
|
type="win32"
|
||||||
|
name="Microsoft.Windows.Common-Controls"
|
||||||
|
version="6.0.0.0"
|
||||||
|
processorArchitecture="*"
|
||||||
|
publicKeyToken="6595b64144ccf1df"
|
||||||
|
language="*"
|
||||||
|
/>
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
</assembly>
|
||||||
@@ -119,6 +119,8 @@ namespace KeyGo
|
|||||||
/// 删除热键项
|
/// 删除热键项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void BtnDel_Click(object sender, EventArgs e)
|
private void BtnDel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("是否确定删除该热键?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -133,3 +135,4 @@ namespace KeyGo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# KeyGo
|
# KeyGo
|
||||||
ͨ<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD>ȼ<EFBFBD> <20><><EFBFBD><EFBFBD>/<2F>л<EFBFBD><D0BB><EFBFBD>/<2F><>С<EFBFBD><D0A1> Ԥ<><D4A4>Ӧ<EFBFBD>õ<EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD>
|
通过注册热键 启动/切换到/最小化 预设应用的小工具
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
Reference in New Issue
Block a user