When I open a graphics window for a program, how do I associate it with 'stdin', 'stdout', 'stderr', in place of the original 'console' window?