How to tell if running in console or winexe mode?



Is there anyway to tell from within your code, either at compile-time or run-time your assembly is running as a console app (exe) or windows gui app (winexe)?

I wanted to for example create simple beep() and msgbox() functions that work differently in either mode.

.