Detecting Windows from non-Windows program 
Author Message
 Detecting Windows from non-Windows program

Is there any way for a DOS-based program to detect whether it is running under
Windows or Windows 95?



Wed, 18 Jun 1902 08:00:00 GMT  
 Detecting Windows from non-Windows program


Quote:
>Is there any way for a DOS-based program to detect whether it is running under
>Windows or Windows 95?

This is what I use (bp7.0 real-mode):

FUNCTION TaskMultiplexerActive:BOOLEAN;
{detect whether this program is running under windows!}
VAR Regs   :TREGISTERS;
    ExtMode:BYTE;
BEGIN
{start optimistic}
  TaskMultiplexerActive := FALSE;
{call multiplexer using assembler because borland won't cooparate here!}
  ASM
    MOV AX, $1600
    INT $2F
    MOV ExtMode, AL
  END;
{branch on result}
  CASE ExtMode OF
    $00,
    $80: WITH Regs DO
         BEGIN
           AX := $4680;
           intr($2F,Regs);
           IF AL = $80 THEN EXIT; {it was not active}
           TaskMultiplexerActive := TRUE;
         END;
    ELSE TaskMultiplexerActive := TRUE;
  END;
END; {TaskMultiplexerActive}

It doesn't actually detect windows but in practice it works fine.

Peter de Jong



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. how can I launch a windows program from my windows program

2. non-rectangular windows

3. Non Modal Dialog windows

4. detecting windows version from TP7?

5. Detecting OS/Windows

6. Detecting OS/Windows

7. Detecting Windows from a dos box...

8. Detect Windows 98

9. Detecting Windows

10. Detecting Windows DOS box

11. Q: Detecting Windows version.

12. Detecting Windows NT

 

 
Powered by phpBB® Forum Software