mirror of
https://github.com/jie65535/KeyGo.git
synced 2025-06-02 17:39:13 +08:00
清理代码
This commit is contained in:
parent
077b8b1e13
commit
c7ac1341cc
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||||
</startup>
|
</startup>
|
||||||
</configuration>
|
</configuration>
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace KeyGo
|
namespace KeyGo
|
||||||
@ -29,7 +24,6 @@ namespace KeyGo
|
|||||||
/// </value>
|
/// </value>
|
||||||
public bool CloseToHide { get; set; } = true;
|
public bool CloseToHide { get; set; } = true;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the XML.
|
/// Loads the XML.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -68,4 +62,4 @@ namespace KeyGo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -151,6 +151,7 @@ namespace KeyGo
|
|||||||
|
|
||||||
[DllImport("User32.dll")]
|
[DllImport("User32.dll")]
|
||||||
private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
|
private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
|
||||||
|
|
||||||
[DllImport("User32.dll")]
|
[DllImport("User32.dll")]
|
||||||
private static extern bool ShowWindow(IntPtr hWnd, int cmdShow);
|
private static extern bool ShowWindow(IntPtr hWnd, int cmdShow);
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
namespace KeyGo
|
namespace KeyGo
|
||||||
{
|
{
|
||||||
public class AppHotKey
|
public static class AppHotKey
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 注册热键
|
/// 注册热键
|
||||||
@ -17,14 +17,7 @@ namespace KeyGo
|
|||||||
public static void RegKey(IntPtr hwnd, int hotKey_id, KeyModifiers keyModifiers, Keys key)
|
public static void RegKey(IntPtr hwnd, int hotKey_id, KeyModifiers keyModifiers, Keys key)
|
||||||
{
|
{
|
||||||
if (!RegisterHotKey(hwnd, hotKey_id, keyModifiers, key))
|
if (!RegisterHotKey(hwnd, hotKey_id, keyModifiers, key))
|
||||||
{
|
|
||||||
throw new Win32Exception();
|
throw new Win32Exception();
|
||||||
//int code = Marshal.GetLastWin32Error();
|
|
||||||
//if (code == 1409)
|
|
||||||
// MessageBox.Show("热键被占用!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
//else
|
|
||||||
// MessageBox.Show("注册热键失败!错误代码:" + code.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -38,7 +31,6 @@ namespace KeyGo
|
|||||||
UnregisterHotKey(hwnd, hotKey_id);
|
UnregisterHotKey(hwnd, hotKey_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//如果函数执行成功,返回值不为0。
|
//如果函数执行成功,返回值不为0。
|
||||||
//如果函数执行失败,返回值为0。要得到扩展错误信息,调用GetLastError。
|
//如果函数执行失败,返回值为0。要得到扩展错误信息,调用GetLastError。
|
||||||
[DllImport("user32.dll", SetLastError = true)]
|
[DllImport("user32.dll", SetLastError = true)]
|
||||||
|
@ -12,6 +12,7 @@ namespace KeyGo
|
|||||||
}
|
}
|
||||||
|
|
||||||
public HotKeyItem HotKeyItem { get; set; }
|
public HotKeyItem HotKeyItem { get; set; }
|
||||||
|
|
||||||
private void FormHotKey_Load(object sender, EventArgs e)
|
private void FormHotKey_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (HotKeyItem != null)
|
if (HotKeyItem != null)
|
||||||
@ -110,6 +111,5 @@ namespace KeyGo
|
|||||||
TxtStartupPath.Text = frm.FileName;
|
TxtStartupPath.Text = frm.FileName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -325,6 +325,6 @@ namespace KeyGo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion 开机自启动
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ using System.Runtime.InteropServices;
|
|||||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||||
[assembly: Guid("09416937-868e-4ee4-80ee-5e6fa81e2811")]
|
[assembly: Guid("09416937-868e-4ee4-80ee-5e6fa81e2811")]
|
||||||
|
|
||||||
// 程序集的版本信息由下列四个值组成:
|
// 程序集的版本信息由下列四个值组成:
|
||||||
//
|
//
|
||||||
// 主版本
|
// 主版本
|
||||||
// 次版本
|
// 次版本
|
||||||
@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
|
|||||||
//通过使用 "*",如下所示:
|
//通过使用 "*",如下所示:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.1.2")]
|
[assembly: AssemblyVersion("0.1.2")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Loading…
Reference in New Issue
Block a user