diff --git a/LiveWallpaper/Program.cs b/LiveWallpaper/Program.cs index 71b74c29..6a3dbb4b 100644 --- a/LiveWallpaper/Program.cs +++ b/LiveWallpaper/Program.cs @@ -8,9 +8,9 @@ namespace LiveWallpaper class Program { [STAThread] - static void Main(string[] args) + static void Main() { - Application.SetHighDpiMode(HighDpiMode.SystemAware); + Application.SetHighDpiMode(HighDpiMode.PerMonitorV2); Application.Run(new AppContext()); } } diff --git a/LiveWallpaperEngineAPI/Forms/LiveWallpaperRenderForm.cs b/LiveWallpaperEngineAPI/Forms/LiveWallpaperRenderForm.cs index 5f695a51..13593d92 100644 --- a/LiveWallpaperEngineAPI/Forms/LiveWallpaperRenderForm.cs +++ b/LiveWallpaperEngineAPI/Forms/LiveWallpaperRenderForm.cs @@ -12,7 +12,7 @@ namespace Giantapp.LiveWallpaper.Engine.Forms /// public partial class LiveWallpaperRenderForm : Form { - static readonly Dictionary _hosts = new Dictionary(); + static readonly Dictionary _hosts = new(); readonly string _screenName; public LiveWallpaperRenderForm(string screenName) diff --git a/LiveWallpaperEngineAPI/Utils/WallpaperHelper.cs b/LiveWallpaperEngineAPI/Utils/WallpaperHelper.cs index c809445a..d41f06c5 100644 --- a/LiveWallpaperEngineAPI/Utils/WallpaperHelper.cs +++ b/LiveWallpaperEngineAPI/Utils/WallpaperHelper.cs @@ -23,7 +23,7 @@ public class WallpaperHelper #region static //Dictionary - static readonly Dictionary _cacheInstances = new Dictionary(); + static readonly Dictionary _cacheInstances = new(); static IDesktopWallpaper _desktopWallpaperAPI; static uint _slideshowTick; static IntPtr _progman; @@ -54,7 +54,7 @@ public static void RestoreDefaultWallpaper() static string GetDesktopWallpaper() { int MAX_PATH = 260; - string wallpaper = new string('\0', MAX_PATH); + string wallpaper = new('\0', MAX_PATH); _ = User32Wrapper.SystemParametersInfo(User32Wrapper.SPI_GETDESKWALLPAPER, (uint)wallpaper.Length, wallpaper, 0); return wallpaper.Substring(0, wallpaper.IndexOf('\0')); }