PDA

Click to See Complete Forum and Search --> : Which Operating System is running


OlgaV
Nov 8th, 1999, 10:30 PM
Hi!

How can I find out which OS my users are running through VB6?

Thanks,

Olga

Yonatan
Nov 9th, 1999, 11:03 AM
Option Explicit


Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type


Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long


Private Const VER_PLATFORM_WIN32s = 0
Private Const VER_PLATFORM_WIN32_WINDOWS = 1
Private Const VER_PLATFORM_WIN32_NT = 2


Private Sub Form_Load()
Dim OVI As OSVERSIONINFO
AutoRedraw = True
OVI.dwOSVersionInfoSize = Len(OVI)
Call GetVersionEx(OVI)
Print "You are running Windows ";
Select Case OVI.dwPlatformId
Case VER_PLATFORM_WIN32s
Print "3.11 with 32-bit support"
Case VER_PLATFORM_WIN32_WINDOWS
Print "95/98"
Case VER_PLATFORM_WIN32_NT
Print "NT"
End Select
End Sub


------------------
Yonatan
Teenage Programmer
E-Mail: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)

OlgaV
Nov 9th, 1999, 11:08 AM
Thank you so much, Yonatan!!!!!
Exactly what I wanted!!!!!