[comp.windows.ms] Am I running Windows?

jcmorris@mwunix.mitre.org (Joe Morris) (05/15/91)

There's probably a proper RTFM response for this question somewhere, but...

If a DOS app is running, how can it *reliably* tell if it is in a DOS
window (vs. running from the command line)?  The test has to be valid 
without relying on Windows startup setting environment variables, etc,
and should be usable on any OEM DOS 3.0 or better.  And it should be
a documented interface if possible.

I'm not interested in distinguishing full-screen from windowed displays;
the only question is whether Windows is present in memory.

The situation is that we've got a quite simple TSR (EBIOS.COM; it's part
of YTERM) which blows the system out of the water if the user tries to
remove it from within a DOS window.  Procedures which rely on the 
Windows startup batch file to set flags have proven too easy to
(accidentally) circumvent by some users, so I would like to hardwire in
a test to prevent this.  Suggestions?

Of course, it would be even better if someone at Microsoft would explain
the relationship between a TSR and Windows.  Grumble grumble grumble...

Joe Morris