Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Me said:There is also an API function you could call, but off-hand I don't remember what it is.
Me said:You might try calling OS(5) to get the build number
****************************************************************************************************************
FUNCTION Get_Version
****************************************************************************************************************
LOCAL lcMess AS String
DECLARE INTEGER GetVersion IN kernel32
DECLARE SHORT StrToIntEx IN Shlwapi;
STRING pszString, INTEGER dwFlags, INTEGER @pllRet
lnVersion = GetVersion()
* The low-order word
lnVersionLo = BitRShift(BitLShift(lnVersion, 16), 16)
lcMess = "Major Version: " + TRANSFORM(BitAnd(lnVersionLo, hex2dec("0x00ff"))) + CR_LF
lcMess = lcMess + "Minor Version: " + TRANSFORM(BitRShift(BitAnd(lnVersionLo, hex2dec("0xff00")), 8)) + CR_LF+ CR_LF
* The high-order word
lnVersionHi = BitRShift(BitAnd(lnVersion, hex2dec("0xffff0000")), 16)
lcMess = lcMess + TRANSFORM(lnVersionHi)
MESSAGEBOX(lcMess)
FUNCTION hex2dec (lcHex)
#DEFINE STIF_SUPPORT_HEX 1
LOCAL lnRet
lnRet = 0
IF StrToIntEx (lcHex, STIF_SUPPORT_HEX, @lnRet) = 1
RETURN lnRet
ELSE
RETURN 0
ENDIF
LOCAL WMIService, MySytem, AllSystems
m.WMIService = GETOBJECT("winmgmts:\\.\root\cimv2")
m.AllSystems = m.WMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem",,48)
FOR EACH m.MySytem IN m.AllSystems
? "Caption:", m.MySytem.Caption
? "Version:", m.MySytem.Version
? "BuildNumber:", m.MySytem.BuildNumber
ENDFOR
FUNCTION b32_2_char( intVal ) && assemble structure
LOCAL intLo
LOCAL intHi
LOCAL charVal
intLo = INT( intVal % 65536 )
intHi = INT( intVal / 65536 )
charVal = CHR( INT( intLo % 256 ) );
+ CHR( INT( intLo / 256 ) );
+ CHR( INT( intHi % 256 ) );
+ CHR( INT( intHi / 256 ) )
RETURN charVal
ENDFUNC
FUNCTION char_2_b32( charVal ) && disassemble structure
LOCAL lenVal
LOCAL b32Val
lenVal = LEN( charVal )
IF lenVal != 4
messText = "Error: char_2_b32!"
MESSAGEBOX( messText, 0 + 16 )
RETURN 0
ENDIF
b32Val = ASC( SUBSTR( charVal, 1, 1 ) );
+ ASC( SUBSTR( charVal, 2, 1 ) ) * 256;
+ ASC( SUBSTR( charVal, 3, 1 ) ) * 256 * 256;
+ ASC( SUBSTR( charVal, 4, 1 ) ) * 256 * 256 * 256
RETURN b32Val
ENDFUNC
FUNCTION GetWindowsVersion()
LOCAL osVersionInfo
LOCAL majorVer
LOCAL minorVer
LOCAL buildNo
LOCAL ret
osVersionInfo = b32_2_char( 148 ) + SPACE( 144 )
DECLARE INTEGER RtlGetVersion IN NTDLL.DLL;
STRING @osVersionInfo
ret = RtlGetVersion( @osVersionInfo )
IF ret = 0x00000000
majorVer = char_2_b32( SUBSTR( osVersionInfo, 5, 4 ) )
minorVer = char_2_b32( SUBSTR( osVersionInfo, 9, 4 ) )
buildNo = char_2_b32( SUBSTR( osVersionInfo, 13, 4 ) )
ENDIF
ENDFUNC