Oh, you're also checking whether MainWindowTitle isn't null and using StartsWith. Still possible and a bit faster using LINQ, but probably unreadable. Nevermind.

Change the Console.WriteLine below to a Log.Warn though.