static void Main(string[] args)
{
if (args.Length != 1) {
Console.Error.Write("Incorrect arguments");
Environment.Exit(1);
}
string windowMark = args[0];
// NOTE: Repeat the attempt to find the window ten times with 300ms delay
for (int i = 0; i < 10; i++) {
EnumWindows(CheckWindowTitle, ref windowMark);
Thread.Sleep(300);
}
Console.Error.Write("Window not found");
Environment.Exit(1);
}