Date: Thu, 30 May 1996 08:37:28 +0200 (IST) From: Eli Zaretskii To: "A.Appleyard" Cc: DJGPP AT delorie DOT com Subject: Re: Windows for djgpp In-Reply-To: <16BEEA922D5@fs2.mt.umist.ac.uk> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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).