From c0f750a2f487f0ee0563a7adf5123795031ba5a7 Mon Sep 17 00:00:00 2001 From: Randy Date: Mon, 4 Apr 2022 13:08:17 -0700 Subject: [PATCH] Update to 3.9.4 Fixed a crash when restoring window; removed AltGr --- SharpKeys/AssemblyInfo.cs | 2 +- SharpKeys/Dialog_Main.cs | 20 +++++++++++++++----- SharpKeys/SharpKeys.csproj | 7 ++++--- SharpKeys/app.config | 2 +- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/SharpKeys/AssemblyInfo.cs b/SharpKeys/AssemblyInfo.cs index afed398..5cfac94 100644 --- a/SharpKeys/AssemblyInfo.cs +++ b/SharpKeys/AssemblyInfo.cs @@ -26,4 +26,4 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("3.9.3.0")] +[assembly: AssemblyVersion("3.9.4.0")] diff --git a/SharpKeys/Dialog_Main.cs b/SharpKeys/Dialog_Main.cs index fd7e940..7251f07 100644 --- a/SharpKeys/Dialog_Main.cs +++ b/SharpKeys/Dialog_Main.cs @@ -6,6 +6,7 @@ using System.ComponentModel; using System.IO; using Microsoft.Win32; +using System.Runtime.CompilerServices; namespace SharpKeys { @@ -290,7 +291,7 @@ private void InitializeComponent() this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(522, 25); this.label1.TabIndex = 9; - this.label1.Text = "SharpKeys 3.9.3 - Copyright 2004 - 2022 RandyRants.com"; + this.label1.Text = "SharpKeys 3.9.4 - Copyright 2004 - 2022 RandyRants.com"; // // label2 // @@ -1033,7 +1034,6 @@ private void BuildParseTables() m_hashKeys.Add("E0_1F", "Unknown: 0xE01F"); m_hashKeys.Add("E0_20", "Media: Mute"); - m_hashKeys.Add("E0_2038", "Special: Alt Gr"); m_hashKeys.Add("E0_21", "App: Calculator"); m_hashKeys.Add("E0_22", "Media: Play/Pause"); m_hashKeys.Add("E0_23", "F-Lock: Spell"); @@ -1344,9 +1344,14 @@ private void Dialog_Main_Paint(object sender, PaintEventArgs e) return; } - Graphics graphics = e.Graphics; - Rectangle rectangle = new Rectangle(0, 0, this.Width, this.Height); + + if ((rectangle.Width <= 0) && (rectangle.Height <= 0)) + { + return; + } + + Graphics graphics = e.Graphics; LinearGradientBrush linearGradientBrush = new LinearGradientBrush(rectangle, Color.FromArgb(188, 188, 188), Color.FromArgb(225, 225, 225), LinearGradientMode.ForwardDiagonal); @@ -1361,9 +1366,14 @@ private void mainPanel_Paint(object sender, PaintEventArgs e) return; } - Graphics graphics = e.Graphics; Rectangle rectangle = new Rectangle(0, 0, mainPanel.Width, mainPanel.Height); + if ((rectangle.Width <= 0) && (rectangle.Height <= 0)) + { + return; + } + + Graphics graphics = e.Graphics; LinearGradientBrush linearGradientBrush = new LinearGradientBrush(rectangle, Color.FromArgb(209, 221, 228), Color.FromArgb(237, 239, 247), //Color.FromArgb(236, 241, 243), LinearGradientMode.Vertical); diff --git a/SharpKeys/SharpKeys.csproj b/SharpKeys/SharpKeys.csproj index 563ad16..63a7d23 100644 --- a/SharpKeys/SharpKeys.csproj +++ b/SharpKeys/SharpKeys.csproj @@ -1,5 +1,5 @@  - + Local 9.0.30729 @@ -32,8 +32,9 @@ SAK SAK SAK - v4.0 - Client + v4.8 + + publish\ true Disk diff --git a/SharpKeys/app.config b/SharpKeys/app.config index f76deb9..99dca75 100644 --- a/SharpKeys/app.config +++ b/SharpKeys/app.config @@ -1,3 +1,3 @@ - +