diff --git a/src/WinGif/Extensions.cs b/src/WinGif/Extensions.cs index 5a9718b..533d8c8 100644 --- a/src/WinGif/Extensions.cs +++ b/src/WinGif/Extensions.cs @@ -8,11 +8,17 @@ namespace WinGif internal static class Extensions { + internal static IServiceProvider LogVersion(this IServiceProvider provider) { + var version = Assembly.GetExecutingAssembly().GetCustomAttribute()?.InformationalVersion; + + Program.Title = $"WinGif {version} by Matt Janda"; + Console.Title = Program.Title; + provider .GetRequiredService>() - .LogInformation("WinGif {version}", Assembly.GetExecutingAssembly().GetCustomAttribute()?.InformationalVersion); + .LogInformation("WinGif {version}", version); return provider; } diff --git a/src/WinGif/Program.cs b/src/WinGif/Program.cs index a2d7267..667d733 100644 --- a/src/WinGif/Program.cs +++ b/src/WinGif/Program.cs @@ -10,6 +10,8 @@ namespace WinGif { class Program { + internal static string Title { get; set; } + static void Main(string[] args) { try diff --git a/src/WinGif/Services/CaptureService.cs b/src/WinGif/Services/CaptureService.cs index 664a9ef..44d8759 100644 --- a/src/WinGif/Services/CaptureService.cs +++ b/src/WinGif/Services/CaptureService.cs @@ -41,7 +41,7 @@ public void StartCapture(ICaptureParameters parameters) if (text.Contains(parameters.WindowCaption) || (matched && !parameters.SingleWindow)) { // Do not capture itself - if (!parameters.SingleWindow && text.Contains("WinGif.exe") && !parameters.AllowSelfCapture) + if (!parameters.SingleWindow && text.Contains(Program.Title) && !parameters.AllowSelfCapture) { Thread.Sleep(parameters.CaptureDelay); continue;