$OPTIMIZE ON
$TYPECHECK ON
CONST ctab = CHR$(9)
CONST clf = CHR$(10)
CONST HKEY_CLASSES_ROOT = &H80000000
CONST HKEY_LOCAL_MACHINE = &H80000002
DIM Registry AS QREGISTRY
DECLARE SUB ShowVersion (Sender AS QBUTTON)
CREATE Form AS QFORM
CAPTION = "Windows Version"
Width = 252
Height = 126
Center
CREATE Button1 AS QBUTTON
CAPTION = "Show Windows Version"
Left = 47
Top = 18
Width = 155
Height = 57
OnClick = ShowVersion
END CREATE
END CREATE
SUB ShowVersion
DIM txt AS STRING
WITH Registry
.RootKey = HKEY_LOCAL_MACHINE
.OpenKey("Software\Microsoft\Windows\CurrentVersion", 0)
IF RIGHT$(.readstring("VersionNumber"), 4) = "2222" THEN
txt = "Windows 98 SE"
ELSE
txt = .readstring("VersionNumber")
END IF
SHOWMESSAGE "You are running " + txt
.closekey
END SUB
Form.SHOWMODAL
|