RE: How to tell if running in console or winexe mode?
- From: "AMercer" <AMercer@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 17 Apr 2005 18:09:02 -0700
Using VB and framework 1.1,
Dim b As Boolean = System.Windows.Forms.Application.MessageLoop
b is true if a message pump is running on the current thread, and false if
not. This gives you a runtime test.
In VB, you can start a message loop via Application.Run. Before Run,
MessageLoop returns false, while the main form runs it returns true, and
during termination, it returns false. The moral is that you shouldn't cache
this boolean.
"D H" wrote:
> 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.
>
>
.
- References:
- Prev by Date: RE: .net framework V2.0.40903
- Next by Date: plugging into the explorer shell
- Previous by thread: Re: How to tell if running in console or winexe mode?
- Next by thread: Re: MSDN Universal subscription changes (level and pricing)
- Index(es):
Relevant Pages
|