The main problem here is that you basically know nothing about the program you're launching, only that it's associated with .png files, so checking for windows is possibly very situation-specific and not generally reliable.
What I would do is to check for the whole process instead. At the time of opening the second png, check if the first process is still alive and don't open if it's still is. The HasExited property serves that purpose. Try something like this:
private Process previousProcess = null;
public CreateImage()
{
//Here put png creation as you already have
//Now attempt to open it if the previous instance has closed
if(this.previousProcess == null || this.previousProcess.HasExited)
{
//Either there was no previous image opened or it was already closed, go ahead and open it
Process myProcess = new Process();
myProcess.StartInfo.FileName = @"Labyrinth.png";
myProcess.Start();
//Cache the newly launched process to check for it afterwards
this.previousProcess = myProcess;
}
}
Note that this relies on your program to remain open within two consecutive generations, so it will not detect if you leave the image open, but close and reopen your program instead. Also, the user might reuse the same program opened for the image for doing something else, effectively closing the image but not the process, in which case further generated images will not be shown.
Of course a workaround to all this is to provide some way to display the image in your own program, and optionally giving the user an option to launch a program with it if the like, thus avoiding the problem entirely.
Edit
It seems that it's not necesary to Dispose()
the previous object if the underlying OS process already has been terminated, so removed that line.