detecting windows
- Posted by Jacques Deschjnes <desja at QUEBECTEL.COM> Oct 14, 1996
- 1958 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