Article View: comp.os.msdos.programmer
Article #3579Re: Detecting Windows ?
From: aki
Date: Tue, 10 Nov 1992 21:24
Date: Tue, 10 Nov 1992 21:24
33 lines
1554 bytes
1554 bytes
In article <HPV.92Nov10162244@kelvin.uio.no>, hpv@kelvin.uio.no (Hans Peter Verne) writes:
>
> I'm writing this for a friend who doesn't have access to the net, poor soul.
> Please reply by mail, I'll post a follow-up (if I get any replies...).
>
> Does anyone know a reliable way to determine if windows (tm) is running,
> and under which mode, from a standard dos program ?
>
> I've tried the int2F,1600 function, but to no awail.
>
> Greetings,
> Hans Peter ( hpv@ulrik.uio.no )
Here is one:
is_windows_installed()
{ // says yeah if Windows or SHELL installed
struct REGPACK rp; // Turbo-C
if (peek(0, 0x2F*4)==0) return 0; // no vector check
rp.r_ax=0x1600;
intr (0x2F, &rp); // Look for enhanced mode
if (((rp.r_ax&0xFF)==0x80) || ((rp.r_ax&0xFF)==0)) {
rp.r_ax=0x4680; intr (0x2F, &rp); // Look for /R/S or Shell
if (rp.r_ax!=0) return 0; // !=0 is faster than (rp.r_ax)
}
return 1; // Win's here
}
Aki.
--
/ Phone: 408-662 9664 Fax: 662 9676 | "Aki" pronounced: Ah-Key. I know \
\ 125 Searidge Ct #D, Aptos, CA 95003 | what I'm doing most of the time. /
Technical Details
Message-ID:
<4619@cruzio.santa-cruz.ca.us>Path:
arc1-ca.pugleaf.net!sparky!uunet!ogicse!decwrl!csus.edu!netcom.com!netcomsv!cruzio!akiReferences:
<HPV.92Nov10162244@kelvin.uio.no>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!decwrl!csus.edu!netcom.com!netcomsv!cruzio!aki From: aki@cruzio.santa-cruz.ca.us Newsgroups: comp.os.msdos.programmer Subject: Re: Detecting Windows ? Message-ID: <4619@cruzio.santa-cruz.ca.us> Date: 10 Nov 92 21:24:59 GMT Article-I.D.: cruzio.4619 References: <HPV.92Nov10162244@kelvin.uio.no> Sender: aki@cruzio.santa-cruz.ca.us Reply-To: aki@cruzio.santa-cruz.ca.us Lines: 33