From a0147102b6f21451d045ca6e8adeaa3ba774b92c Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 17 Nov 2020 22:44:02 +0000 Subject: [PATCH 1/5] Added: environment path support --- Models/TileModel.cs | 20 +++++++------------- Windows/Forms/Tile/TTilePanel.cs | 14 +++++++------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Models/TileModel.cs b/Models/TileModel.cs index f195aa8..53f8dcf 100644 --- a/Models/TileModel.cs +++ b/Models/TileModel.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Diagnostics; using System.Drawing; @@ -19,18 +20,11 @@ namespace AppLauncher.Models public override string ToString() => this.Title ?? string.Empty; - //public void Update(TileModel model) - //{ - // this.Title = model.Title; - // this.ProcessFilename = model.ProcessFilename; - // this.ProcessArgument = model.ProcessArgument; - // this.ProcessWorkingDirectory = model.ProcessWorkingDirectory; - // this.ProcessWindowStyle = model.ProcessWindowStyle; - // this.ProcessAsAdmin = model.ProcessAsAdmin; - // this.Position = model.Position; - // this.IsGroup = model.IsGroup; - // this.Items = model.Items; - //} + public string CleanProcessFilename => (string.IsNullOrWhiteSpace(this.ProcessFilename) ? string.Empty : Environment.ExpandEnvironmentVariables(this.ProcessFilename)); + + public string CleanProcessArgument => (string.IsNullOrWhiteSpace(this.ProcessArgument) ? string.Empty : Environment.ExpandEnvironmentVariables(this.ProcessArgument)); + + public string CleanProcessWorkingDirectory => (string.IsNullOrWhiteSpace(this.ProcessWorkingDirectory) ? string.Empty : Environment.ExpandEnvironmentVariables(this.ProcessWorkingDirectory)); } } diff --git a/Windows/Forms/Tile/TTilePanel.cs b/Windows/Forms/Tile/TTilePanel.cs index dd28ad7..88ad239 100644 --- a/Windows/Forms/Tile/TTilePanel.cs +++ b/Windows/Forms/Tile/TTilePanel.cs @@ -283,21 +283,21 @@ namespace AppLauncher.Windows.Forms return; } - if (string.IsNullOrWhiteSpace(model.ProcessFilename)) + if (string.IsNullOrWhiteSpace(model.CleanProcessFilename)) { return; } - if (!File.Exists(model.ProcessFilename)) + if (!File.Exists(model.CleanProcessFilename)) { return; } ProcessStartInfo p = new ProcessStartInfo(); - p.FileName = model.ProcessFilename; + p.FileName = model.CleanProcessFilename; p.WindowStyle = model.ProcessWindowStyle; - if (!string.IsNullOrWhiteSpace(model.ProcessArgument)) p.Arguments = model.ProcessArgument; - if (!string.IsNullOrWhiteSpace(model.ProcessWorkingDirectory)) p.WorkingDirectory = model.ProcessWorkingDirectory; + if (!string.IsNullOrWhiteSpace(model.CleanProcessArgument)) p.Arguments = model.CleanProcessArgument; + if (!string.IsNullOrWhiteSpace(model.CleanProcessWorkingDirectory)) p.WorkingDirectory = model.CleanProcessWorkingDirectory; if (model.ProcessAsAdmin) p.Verb = "runas"; MainForm parentForm = findMainForm(); @@ -324,14 +324,14 @@ namespace AppLauncher.Windows.Forms protected Image getIcon(TileModel model) { - if (!File.Exists(model.ProcessFilename)) + if (!File.Exists(model.CleanProcessFilename)) { return null; } try { - return Icon.ExtractAssociatedIcon(model.ProcessFilename)?.ToBitmap(); + return Icon.ExtractAssociatedIcon(model.CleanProcessFilename)?.ToBitmap(); } catch { From 1577dcc24ec7d0f9a33cd2fae06b9163e364e6d0 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 19 Nov 2020 00:22:34 +0000 Subject: [PATCH 2/5] Changed: build config' --- FizzyLauncher.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FizzyLauncher.csproj b/FizzyLauncher.csproj index 0ccca88..d707ee4 100644 --- a/FizzyLauncher.csproj +++ b/FizzyLauncher.csproj @@ -10,7 +10,7 @@ fizzylauncher v4.7.2 512 - true + false true From 40e5f65e57923bccf2e795ce1d781f15c8ecdc71 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 21 Nov 2020 00:14:03 +0000 Subject: [PATCH 3/5] Added: system shut down support --- MainForm.cs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/MainForm.cs b/MainForm.cs index 94f5260..4349ce5 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -26,6 +26,7 @@ namespace AppLauncher //protected const int MOD_SHIFT = 0x4; //protected const int MOD_WIN = 0x8; protected const int WM_HOTKEY = 0x312; + protected const int WM_QUERYENDSESSION = 0x0011; protected OptionsForm optionsForm = null; protected string sessionFilename = null; @@ -127,17 +128,25 @@ namespace AppLauncher protected override void WndProc(ref Message m) { - base.WndProc(ref m); - - if (m.Msg != WM_HOTKEY) return; - - switch (m.WParam.ToInt32()) + switch (m.Msg) { - case 1: - this.Visible = !this.Visible; + case WM_HOTKEY: + if (m.WParam.ToInt32() == 1) + { + this.Visible = !this.Visible; + } + + break; + case WM_QUERYENDSESSION: + requestExit = true; + this.Close(); + break; default: break; + } + + base.WndProc(ref m); } public LauncherSession CurrentSession { get; set; } = null; From ce441026917ae85b78512ef52db4254afde75030 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 21 Nov 2020 00:31:20 +0000 Subject: [PATCH 4/5] Changed: build no --- FizzyLauncher.csproj | 4 +++- Properties/AssemblyInfo.cs | 2 +- Properties/Settings.Designer.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/FizzyLauncher.csproj b/FizzyLauncher.csproj index d707ee4..0d713d3 100644 --- a/FizzyLauncher.csproj +++ b/FizzyLauncher.csproj @@ -8,10 +8,11 @@ WinExe AppLauncher fizzylauncher - v4.7.2 + v4.8 512 false true + AnyCPU @@ -134,6 +135,7 @@ TTilePanel.cs + SettingsSingleFileGenerator diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0c3a60f..01b4147 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.1.1.153")] +[assembly: AssemblyFileVersion("0.1.1.158")] diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index 8649fed..85a6f63 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace AppLauncher.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); From 57312775cac87d4e3afee8a6babb4f9e6acae404 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 21 Nov 2020 00:34:59 +0000 Subject: [PATCH 5/5] Fixed: missing file --- FizzyLauncher.csproj | 1 - build-release.bat | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FizzyLauncher.csproj b/FizzyLauncher.csproj index 0d713d3..8d405c8 100644 --- a/FizzyLauncher.csproj +++ b/FizzyLauncher.csproj @@ -135,7 +135,6 @@ TTilePanel.cs - SettingsSingleFileGenerator diff --git a/build-release.bat b/build-release.bat index 6875a19..4647cd4 100644 --- a/build-release.bat +++ b/build-release.bat @@ -1 +1,2 @@ -"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" "skye.sln" /T:Build /P:Configuration=Release \ No newline at end of file +"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" "skye.sln" /T:Build /P:Configuration=Release +PAUSE \ No newline at end of file