delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/30/01:39:45

Date: Thu, 30 May 1996 08:37:28 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Cc: DJGPP AT delorie DOT com
Subject: Re: Windows for djgpp
In-Reply-To: <16BEEA922D5@fs2.mt.umist.ac.uk>
Message-Id: <Pine.SUN.3.91.960530083039.14387I-100000@is>
Mime-Version: 1.0

On Wed, 29 May 1996, A.Appleyard wrote:

>   When I run a djgpp program from Windows, and I run it in a `DOS box' window
> and not full screen, the program thinks that the DOS box is the full screen.
>   I just tried running in a DOS box under Windows a program that I wrote that
> makes graphics. When the program tried to change screen mode to the graphics
> mode, Windows swore at me and changed the job from box mode to full-screen
> mode.

That is a Windows `feature'.  If it decides it cannot support a certain 
video mode unless it switches to full screen, it does so without asking.  
The problem is that the support for any given video mode depends on the 
video driver that's loaded at startup, and that depends on the particular 
hardware and system configuration on each system.  I don't think you can 
do anything here.

>   (0) Detect whether it was running under Windows or not.

That is easy.  Many programs just check for `windir' environment variable 
be defined, but that isn't robust enough (IMHO), because if I set it from 
the DOS prompt, I can fool such programs.  Better ways are described in 
e.g. "Undocumented DOS".

>   (1) Not create a DOS box but run directly under Windows.

DJGPP doesn't support writing Windows programs, unless you use RSXWDK.

>   (2) Find the screen mode & the apparent address of the start of the screen:
> it could do all screen-saving and screen-restoring itself if it had to.

To a DOS program, this should be the same as under DOS.  But you cannot 
see the entire screen, only the part thereof that belongs to your program 
(if you run in a windowed DOS box).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019