|
-
Apr 2nd, 2002, 01:34 PM
#1
Thread Starter
Hyperactive Member
finding Windows Version
I know there's one at http://www.vbforums.com/showthread.p...hreadid=157607 but when I tryed adding in the ones for the Windows XP and 2000 and such, I just get debugging errors....can someone give me the full codeing of it (with the 2000 and XP in it too)?? thanks.
p|-|34|2 /\/\3 f0|2 | $p34k 1337 
My TSS quote of the day: "If your haveing a bad day, just press the restart button."
-
Apr 2nd, 2002, 01:42 PM
#2
-
Apr 2nd, 2002, 03:22 PM
#3
Thread Starter
Hyperactive Member
it seems like you didn't read all the way thru. I did put that code in, but when I tryed puting in:
VB Code:
.dwMajorVersion = 5 ' win2K or XP
.dwMinorVersion = 0 ' Win 2000
.dwMinroVersion = 1 ' Win XP
or something like that, I just get a error, so I wantted to know what the full code with that part in it looks like. thanks
p|-|34|2 /\/\3 f0|2 | $p34k 1337 
My TSS quote of the day: "If your haveing a bad day, just press the restart button."
-
Apr 2nd, 2002, 10:26 PM
#4
Thread Starter
Hyperactive Member
sorry for doing this but....^bump^
p|-|34|2 /\/\3 f0|2 | $p34k 1337 
My TSS quote of the day: "If your haveing a bad day, just press the restart button."
-
Apr 2nd, 2002, 10:38 PM
#5
You should read my thread, but anyway
put this in a module
VB Code:
'constants returned by OperatingSystem
Global Const Windows95 As Integer = 95
Global Const Windows98 As Integer = 98
Global Const WindowsNT3 As Integer = 3 'v3.51
Global Const WindowsNT4 As Integer = 4
Global Const WindowsXP As Integer = 1
Put this on your form
VB Code:
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 GetVersionExA Lib "kernel32" (lpVersionInformation As OSVersionInfo) As Integer
Public Function OperatingSystem() As Integer
Dim OSInfo As OSVersionInfo
Dim RetValue As Integer
OSInfo.dwOSVersionInfoSize = 148
OSInfo.szCSDVersion = Space$(128)
RetValue = GetVersionExA(OSInfo)
With OSInfo
Select Case .dwPlatformID
Case 1
If .dwMinorVersion = 0 Then
OperatingSystem = Windows95
ElseIf .dwMinorVersion = 10 Then
OperatingSystem = Windows98
End If
Case 2
If .dwMajorVersion = 3 Then
OperatingSystem = WindowsNT3
ElseIf .dwMajorVersion = 4 Then
OperatingSystem = WindowsNT4
ElseIf .dwMinorVersion = 1 Then
OperatingSystem = WindowsXP ' Win XP
ElseIf .dwMinorVersion = 0 Then
OperatingSystem = Windows2000 ' Win 2000
End If
Case Else
OperatingSystem = 0
End Select
End With
End Function
If you want an image to show, or a message box to pop up, do this :
VB Code:
Private Sub Form_Load()
If OperatingSystem = WindowsXP Then 'what you want it to do. You can change WindowsXP to Windows98, Windows2000 and so on.
End Sub
-
Apr 2nd, 2002, 11:14 PM
#6
Thread Starter
Hyperactive Member
I just get this error that you see in the picture below 
p|-|34|2 /\/\3 f0|2 | $p34k 1337 
My TSS quote of the day: "If your haveing a bad day, just press the restart button."
-
Apr 3rd, 2002, 01:21 AM
#7
Thread Starter
Hyperactive Member
p|-|34|2 /\/\3 f0|2 | $p34k 1337 
My TSS quote of the day: "If your haveing a bad day, just press the restart button."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|