brr, system("pause") is not a good idea, have a look at this http://www.gidnetwork.com/b-61.html to see why this works, and what it really does.
DanPaul:
to show issues during process, there must not be used GUI - as far as I understand tool requirements.
must not, is a heavy word. Is the message center not good enough to show your issues ? In case of critical things you might even open an alert box.
DanPaul:
mdlSystem_getStringFromConsole
As far as I understood this function, it breaks your program to ensure that an input is taken from the console, as this is the only chance to get some input without a modal dialog, as you can not rely on the keyIn window. But this one waits exactly for the input and returns than.
Back to your original calls. GetConsoleWindow() will return NULL if there is no console window assigned to an application. I would at least test against this. GetForeGroundWindow() might return the applications main window handle, if the console window is not brought to foreground, so this system-function is not safe here.
Not sure what happend here, and how the shown console window is implemented (if it is a 'real' console window at all).
We need to wait for some statement from Bentley I think.