1. detecting windows
- Posted by Jacques Deschjnes <desja at QUEBECTEL.COM> Oct 14, 1996
- 1959 views
One can use the following function to detect if an euphoria program is running under windows. information source : La Bible PC, by Micheal Tischer, Ed. Micro applications. atom WinVer function WindowIsRunning() -- check if euphoria program is running under window -- return 0 if windows not detected. sequence r integer r_AL r = repeat(0,10) r[REG_AX] = #1600 r = dos_interrupt(MULTIPLEX,r) r_AL = remainder(r[REG_AX],256) if r_AL = 1 or r_AL = 255 then WinVer = 2.00 return 1 elsif r_AL = 0 or r_AL = #80 then r[REG_AX] = #4680 r = dos_interrupt(MULTIPLEX,r) r_AL = remainder(r[REG_AX],256) if r_AL = #80 then WinVer = 0 return 0 -- windows not running else WinVer = 3.00 return 1 end if else --windows is running in extended mode, version in ax, al=major,ah=minor WinVer = r_AL + floor(r[REG_AX]/256)/100 return 1 end if end function -- WindowIsRunning() Jacques Deschenes
2. Re: detecting windows
- Posted by John Kinne <JDKINNE at MIAMIU.BITNET> Oct 15, 1996
- 1926 views
Jacques, another neat routine! The installer I wrote in Euphoria needs to know if Windows is running - it invokes a pgm that will fail under windows. I do a if atom(getenv("windir")) then return FALSE end if return TRUE Your routine is more elegant & provides more info. John Kinne