diff --git a/Classes/WindowsInterface.cs b/Classes/WindowsInterface.cs index c8b928ae..6d3c8660 100644 --- a/Classes/WindowsInterface.cs +++ b/Classes/WindowsInterface.cs @@ -10,6 +10,7 @@ using System.IO; using System.Net; using System.Net.Sockets; +using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Windows.Forms; @@ -22,6 +23,15 @@ public partial class WindowsInterface : Form { public static WindowsInterface Instance; private static Socket listener; + [DllImport("DwmApi")] + private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, int[] attrValue, int attrSize); + + // https://stackoverflow.com/a/64927217 + protected override void OnHandleCreated(EventArgs e) { + if (DwmSetWindowAttribute(Handle, 19, new[] { 1 }, 4) != 0) + DwmSetWindowAttribute(Handle, 20, new[] { 1 }, 4); + } + public WindowsInterface() { Instance = this; InitializeComponent();