Page 1 of 1

[windows] GetWindowVersion

Posted: Thu Sep 12, 2002 1:10 am
by BackupUser
Code updated for 5.20+

Restored from previous forum. Originally posted by Hi-Toro.

This will return a string with the version of Windows in use. NOTE: You might prefer to return the 'os\dwPlatformId' value instead...

Code: Select all

Procedure.s GetWindows ()
  
  os.OSVERSIONINFO
  os\dwOSVersionInfoSize = SizeOf (OSVERSIONINFO)
  
  GetVersionEx_ (os)
  
  Select os\dwPlatformId
    Case #VER_PLATFORM_WIN32_NT
      
      If (os\dwMajorVersion >= 5)
        win$ = "Windows 2000/XP"
      Else
        win$ = "Windows NT"
      EndIf
      
    Case #VER_PLATFORM_WIN32_WINDOWS
      
      If(os\dwMinorVersion < 10)
        win$ = "Windows 95"
      EndIf
      
    Default
      
      If (os\dwMinorVersion < 90)
        win$ = "Windows 98"
      Else
        win$ = "Windows ME"
      EndIf
      
  EndSelect
  
  ProcedureReturn win$
  
EndProcedure

MessageRequester ("", "Result: " + GetWindows (), #MB_ICONINFORMATION)
--
See ya,
James L Boyd.
http://www.hi-toro.com/
--