diff --git a/KeyGo/App.config b/KeyGo/App.config index 88fa402..2ae8254 100644 --- a/KeyGo/App.config +++ b/KeyGo/App.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/KeyGo/AppConfig.cs b/KeyGo/AppConfig.cs index 47b6273..51b456c 100644 --- a/KeyGo/AppConfig.cs +++ b/KeyGo/AppConfig.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.IO; using System.Xml.Serialization; namespace KeyGo @@ -29,7 +24,6 @@ namespace KeyGo /// public bool CloseToHide { get; set; } = true; - /// /// Loads the XML. /// @@ -68,4 +62,4 @@ namespace KeyGo } } } -} +} \ No newline at end of file diff --git a/KeyGo/AppControl.cs b/KeyGo/AppControl.cs index 808758f..33fd5fc 100644 --- a/KeyGo/AppControl.cs +++ b/KeyGo/AppControl.cs @@ -151,6 +151,7 @@ namespace KeyGo [DllImport("User32.dll")] private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow); + [DllImport("User32.dll")] private static extern bool ShowWindow(IntPtr hWnd, int cmdShow); diff --git a/KeyGo/AppHotKey.cs b/KeyGo/AppHotKey.cs index 6057a51..df2ce2f 100644 --- a/KeyGo/AppHotKey.cs +++ b/KeyGo/AppHotKey.cs @@ -5,7 +5,7 @@ using System.Windows.Forms; namespace KeyGo { - public class AppHotKey + public static class AppHotKey { /// /// 注册热键 @@ -17,14 +17,7 @@ namespace KeyGo public static void RegKey(IntPtr hwnd, int hotKey_id, KeyModifiers keyModifiers, Keys key) { if (!RegisterHotKey(hwnd, hotKey_id, keyModifiers, key)) - { 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); - } } /// @@ -38,7 +31,6 @@ namespace KeyGo UnregisterHotKey(hwnd, hotKey_id); } - //如果函数执行成功,返回值不为0。 //如果函数执行失败,返回值为0。要得到扩展错误信息,调用GetLastError。 [DllImport("user32.dll", SetLastError = true)] diff --git a/KeyGo/FormHotKey.cs b/KeyGo/FormHotKey.cs index bb1c4b4..39258ba 100644 --- a/KeyGo/FormHotKey.cs +++ b/KeyGo/FormHotKey.cs @@ -12,6 +12,7 @@ namespace KeyGo } public HotKeyItem HotKeyItem { get; set; } + private void FormHotKey_Load(object sender, EventArgs e) { if (HotKeyItem != null) @@ -110,6 +111,5 @@ namespace KeyGo TxtStartupPath.Text = frm.FileName; } } - } } \ No newline at end of file diff --git a/KeyGo/FormMain.cs b/KeyGo/FormMain.cs index 5a1acad..2ac1d56 100644 --- a/KeyGo/FormMain.cs +++ b/KeyGo/FormMain.cs @@ -325,6 +325,6 @@ namespace KeyGo } } - #endregion + #endregion 开机自启动 } } \ No newline at end of file diff --git a/KeyGo/Properties/AssemblyInfo.cs b/KeyGo/Properties/AssemblyInfo.cs index caf2ebe..cfb63ec 100644 --- a/KeyGo/Properties/AssemblyInfo.cs +++ b/KeyGo/Properties/AssemblyInfo.cs @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("09416937-868e-4ee4-80ee-5e6fa81e2811")] -// 程序集的版本信息由下列四个值组成: +// 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 @@ -32,4 +32,4 @@ using System.Runtime.InteropServices; //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.2")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file