From a45d0d80173c2e5a7f6fe929543e0f1c3bccf187 Mon Sep 17 00:00:00 2001 From: Peter Kirmeier Date: Sat, 24 Oct 2020 19:50:15 +0200 Subject: [PATCH] [BUG] Corrected DPI Awareness Mode Pre-set Per-Monitor DPI Awareness Mode via new Manifest file This also resolves #137 as window will be drawn at correct location --- Properties/AssemblyInfo.cs | 4 +-- Resources/app.manifest | 12 +++++++++ SystemTrayMenu.csproj | 1 + UserInterface/TaskbarForm.Designer.cs | 36 +++++++++++++-------------- 4 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 Resources/app.manifest diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index baa1fa2..fff3c97 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -39,5 +39,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.17.2")] -[assembly: AssemblyFileVersion("1.0.17.2")] +[assembly: AssemblyVersion("1.0.17.3")] +[assembly: AssemblyFileVersion("1.0.17.3")] diff --git a/Resources/app.manifest b/Resources/app.manifest new file mode 100644 index 0000000..08b40b3 --- /dev/null +++ b/Resources/app.manifest @@ -0,0 +1,12 @@ + + + + + + + PerMonitor + true + + + + diff --git a/SystemTrayMenu.csproj b/SystemTrayMenu.csproj index 81effb1..f9d71e9 100644 --- a/SystemTrayMenu.csproj +++ b/SystemTrayMenu.csproj @@ -227,5 +227,6 @@ EXIT 0 LICENSE SystemTrayMenu + Resources\app.manifest \ No newline at end of file diff --git a/UserInterface/TaskbarForm.Designer.cs b/UserInterface/TaskbarForm.Designer.cs index 1da5ccd..f539117 100644 --- a/UserInterface/TaskbarForm.Designer.cs +++ b/UserInterface/TaskbarForm.Designer.cs @@ -28,24 +28,24 @@ /// private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TaskbarForm)); - this.SuspendLayout(); - // - // TaskbarForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.White; - this.ClientSize = new System.Drawing.Size(120, 0); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.Name = "TaskbarForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Text = "STM"; - this.LocationChanged += new System.EventHandler(this.TaskbarForm_LocationChanged); - this.ResumeLayout(false); - + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TaskbarForm)); + this.SuspendLayout(); + // + // TaskbarForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(120, 0); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "TaskbarForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; + this.Text = "STM"; + this.LocationChanged += new System.EventHandler(this.TaskbarForm_LocationChanged); + this.ResumeLayout(false); + } #endregion