Hi. I’m trying to detect Windows 11 using an older version of Xojo (2018) without using plugins.
GetVersionExA and GetVersionExW doesn’t work so I found this on the forum but need some help converting it to work with Xojo.
Private Declare Function RtlGetVersion Lib "NTDLL" (ByRef lpVersionInformation As Long) As Long
Public Sub NativeGetVersion(ByRef plMajorVer As Long, ByRef plMinorVer As Long)
Dim tOSVw(&H54) As Long
tOSVw(0) = &H54 * &H4
RtlGetVersion tOSVw(0)
plMajorVer = tOSVw(1)
plMinorVer = tOSVw(2)
End Sub
Dim lOSMajorVer As Long
Dim lOSMinorVer As Long
NativeGetVersion lOSMajorVer, lOSMinorVer
bIsWin10 = (lOSMajorVer >= 10)
Can anyone lend a hand or provide a better solution?
Thanks!
9 posts - 5 participants