I need to bring the console from an C# form/console application to the front. I got the following code which will bring the console window to front from: bring a console window to front in c#
However why does this code example also prints true and how can I disable it?
public static void ToFront()
{
string originalTitle = Console.Title;
string uniqueTitle = Guid.NewGuid().ToString();
Console.Title = uniqueTitle;
Thread.Sleep(50);
IntPtr handle = FindWindowByCaption(IntPtr.Zero, uniqueTitle);
Console.Title = originalTitle;
Console.WriteLine(SetForegroundWindow(handle));
}