Здравствуйте! Вот Вам код. Поясняю работу, если например у Вас ОС WinXP, то переменная IsWinXP будет равна True, а все остальные False. У меню он отлично работает, если что, то пишите в форуме. Желаю удачи! Private Declare Function GetVersionEx Lib "kernel32" Alias _ "GetVersionExA" (lpVersionInformation As Any) As Long Public IsWin95 As Boolean Public IsWin98 As Boolean Public IsWin2000 As Boolean Public IsWinNT As Boolean Public IsWinXP As Boolean Private osvi As OSVERSIONINFOEX Private mblnVersionInfoEx As Boolean Private Const VER_PLATFORM_WIN32_WINDOWS = 1 Private Const VER_PLATFORM_WIN32_NT = 2 Private Type OSVERSIONINFOEX dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long End Type Private Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 End Type Sub er() Dim osviTmp As OSVERSIONINFO osvi.dwOSVersionInfoSize = Len(osvi) mblnVersionInfoEx = CBool(GetVersionEx(osvi)) If Not mblnVersionInfoEx Then osvi.dwOSVersionInfoSize = Len(osviTmp) Call GetVersionEx(osvi) End If IsWin95 = (osvi.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS _ And osvi.dwMinorVersion = 0) IsWin98 = (osvi.dwMajorVersion = 4 And _ (osvi.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS _ And osvi.dwMinorVersion > 0)) IsWinNT = (osvi.dwPlatformId = VER_PLATFORM_WIN32_NT _ And osvi.dwMajorVersion = 4) IsWin2000 = (osvi.dwPlatformId = VER_PLATFORM_WIN32_NT _ And osvi.dwMajorVersion = 5 And osvi.dwMinorVersion = 0) IsWinXP = (osvi.dwPlatformId = VER_PLATFORM_WIN32_NT _ And osvi.dwMinorVersion = 1) End Sub
Ответить
|