Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-02

Detecting Windows

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Richard Storer

Hi, I am currently writing a program and for it to work correctly it must run in real DOS mode, that is not from an MS-DOS prompt in Windows. Is there any reliable method for detecting the presence of the Windows OS 3.1 9x and NT like interrupt calls perhaps ??

Richard S.

Reply by email

Unknown author
Show quoted text 5 lines
Hi, I am currently writing a program and for it to work correctly it must run in real DOS mode, that is not from an MS-DOS prompt in Windows. Is there any reliable method for detecting the presence of the Windows OS 3.1 9x and NT like interrupt calls perhaps ??

Perhaps this function will work...

Function WindowsRunning : boolean;
var
  regs : registers;
begin
  regs.ax := $00;
  regs.ah := $16;
  regs.al := $0A;
  intr ($2F, regs);
  if regs.ax = 0 then
     WindowsRunning := TRUE
  else
     WindowsRunning := FALSE;
end;

Reply by email