Detecting Windows Application or not

2007-12-22 02:52:31 AM
Suppose I have some non-windows .cpp source code modules which can be
linked into either a VCL Windows application or a Console Application.
Is there a convenient API or a simple method to detect from within a
non-windows module whether or not the application running is part of a
Windows application without making all the source modules have windows
headers ?
The main reason is to know whether to send output messages via say a
Windows message box or a Console cout statement.
Thank for any help!