I'm trying to fix a problem with the wcmd command-line interpreter when running console applications. At present wcmd invokes a child program using CreateProcess() then returns to the command prompt. If the application is GUI this is the correct behaviour, but if it's a console-mode one then wcmd should wait for it to finish before continuing - currently the two programs get mixed up because they are sharing I/O handles. To fix this I believe I need to distinguish between the two types of program. However apart from a flag in the PE header I don't know of any way to tell the difference. Is there a way to do this using Win32 API calls? Alternatively is here any other way to achieve the behaviour of Win9x and NT? Dave Pickles
