diff --git a/TwitchDownloaderWPF/MainWindow.xaml.cs b/TwitchDownloaderWPF/MainWindow.xaml.cs index 05876f92..a6d40d01 100644 --- a/TwitchDownloaderWPF/MainWindow.xaml.cs +++ b/TwitchDownloaderWPF/MainWindow.xaml.cs @@ -153,7 +153,7 @@ private async void FlashTaskbarIconIfNotForeground(TimeSpan flashDuration) FlashCount = uint.MaxValue, Timeout = 0 }; - _ = NativeFunctions.FlashWindowEx(flashWInfo); + _ = NativeFunctions.FlashWindowEx(ref flashWInfo); await Task.Delay(flashDuration); @@ -165,7 +165,7 @@ private async void FlashTaskbarIconIfNotForeground(TimeSpan flashDuration) FlashCount = 0, Timeout = 0 }; - _ = NativeFunctions.FlashWindowEx(stopFlashWInfo); + _ = NativeFunctions.FlashWindowEx(ref stopFlashWInfo); } private class FfmpegDownloadProgress : IProgress diff --git a/TwitchDownloaderWPF/Services/NativeFunctions.cs b/TwitchDownloaderWPF/Services/NativeFunctions.cs index aa788fc4..9bda74c0 100644 --- a/TwitchDownloaderWPF/Services/NativeFunctions.cs +++ b/TwitchDownloaderWPF/Services/NativeFunctions.cs @@ -15,7 +15,7 @@ public static unsafe class NativeFunctions [DllImport("user32.dll", EntryPoint = "FlashWindowEx", PreserveSig = true)] [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool FlashWindowEx(FlashWInfo info); + public static extern bool FlashWindowEx([In] ref FlashWInfo info); // https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-flashwinfo [StructLayout(LayoutKind.Sequential)]