Получение сведений о версии ОС - VB

Формулировка задачи:

Здравствуйте! Спортивный интерес. Как тоже самое переписать для юникодной версии функции ?
Option Explicit
 
Private Type OSVERSIONINFOEX
    dwOSVersionInfoSize As Long
    dwMajorVersion As Long
    dwMinorVersion As Long
    dwBuildNumber As Long
    dwPlatformId As Long
    szCSDVersion As String * 128
    wServicePackMajor As Integer
    wServicePackMinor As Integer
    wSuiteMask As Integer
    wProductType As Byte
    wReserved As Byte
End Type
 
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFOEX) As Long
 
Private Sub form_load()
    Dim osi As OSVERSIONINFOEX
   
    osi.dwOSVersionInfoSize = Len(osi)
    GetVersionEx osi
    stop
end sub
Спасибо.

Код к задаче: «Получение сведений о версии ОС - VB»

textual
Option Explicit
 
Private Type OSVERSIONINFOEX
    dwOSVersionInfoSize As Long
    dwMajorVersion As Long
    dwMinorVersion As Long
    dwBuildNumber As Long
    dwPlatformId As Long
    szCSDVersion(255) As Byte
    wServicePackMajor As Integer
    wServicePackMinor As Integer
    wSuiteMask As Integer
    wProductType As Byte
    wReserved As Byte
End Type
 
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExW" (lpVersionInformation As OSVERSIONINFOEX) As Long
 
Private Sub form_load()
    Dim osi As OSVERSIONINFOEX
    Dim tst As String
   
    osi.dwOSVersionInfoSize = Len(osi)
    GetVersionEx osi
   
    tst = osi.szCSDVersion
   
End Sub

15   голосов, оценка 4.067 из 5


СОХРАНИТЬ ССЫЛКУ