The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
This is not 100% fool proof. How ever in normal cases, this works great. This technique can be used to find out, whether the child application was launched from a GUI application or from a Console application.
if( AttachConsole( ATTACH_PARENT_PROCESS ))
AfxMessageBox( _T("Parent process is a console application"));
AfxMessageBox( _T("Parent process is not a console application"));