Re: Detect if running in Windows environment
- From: Olof Lagerkvist <no@xxxxxxxxxxxxx>
- Date: Wed, 14 Mar 2007 10:45:36 GMT
Herbert Kleebauer wrote:
Sonny wrote:
I have seen past threads about checking if the software is running in
a Windows environment but I think it is not applicable in Win XP.
Using Int 2F/AX=1600h or AX=160Ah or getenv("windir") failed. I mean,
I run the program in Win XP and it did not detect that it is running
in windows (The program ran!). Is there a new way? Thanks.
In Win32 all exe have 16 and 32 bit part. If the program is started
in DOS, then exe is a valid 16 bit exe which, when executed, mostly
just prints "This program requires Windows". If started in Windows,
the 32 bit part is executed. But you can do it also the other way.
Put your program in the 16 bit part of the exe and output in the
32 bit part: "This program requires a real DOS" and exit.
It will still be possible to run the 16-bit program under Windows in that case. All that is required is an ntvdm session started with a config.nt file with the "DOSONLY" directive.
--
Olof Lagerkvist
ICQ: 724451
Web: http://here.is/olof
.
- References:
- Detect if running in Windows environment
- From: Sonny
- Re: Detect if running in Windows environment
- From: Herbert Kleebauer
- Detect if running in Windows environment
- Prev by Date: Re: Detect if running in Windows environment
- Next by Date: Re: Detect if running in Windows environment
- Previous by thread: Re: Detect if running in Windows environment
- Next by thread: Re: Detect if running in Windows environment
- Index(es):
Relevant Pages
|