Урок 8
Какая операционная система установлена: Win98 или NT.
Код:
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" _
(lpVersionInformation As OSVERSIONINFO) As Long
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Const VER_PLATFORM_WIN32s = 0
Const VER_PLATFORM_WIN32_WINDOWS = 1
Const VER_PLATFORM_WIN32_NT = 2
Public Function WinNT() As Boolean
Dim info As OSVERSIONINFO
info.dwOSVersionInfoSize = Len(info)
GetVersionEx info
WinNT = (info.dwPlatformId = VER_PLATFORM_WIN32_NT)
End Function
Public Function Win98() As Boolean
Dim info As OSVERSIONINFO
info.dwOSVersionInfoSize = Len(info)
GetVersionEx info
Win98 = (info.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS And info.dwMinorVersion >= 10 And info.dwMajorVersion = 4)
End Function
Private Sub Form_Resize()
bWindowsNT = WinNT()
Print bWindowsNT
bWindows98 = Win98()
Print bWindows98
В разделе Примеры, Вы можете скачать пример этого урока.
Назад