GetVersion VB声明 
Declare Function GetVersion Lib "kernel32" Alias "GetVersion" () As Long 
说明 
判断当前运行的Windows和DOS版本 
返回值 
Long,低16位包含了windows版本;低字节包含了主版本号(3代表windows 3.10,4代表nt 4.0);高字节包含了两个数位的辅助版本号(10代表windows 3.10,95代表windows 95)。高16位则包含了平台信息。针对windows NT,高位设为0;针对windows for workgroups上运行的Win32s,则高位为1 
注解 
在win32下,最好换用GetVersionEx函数。在win32下,高字不会返回DOS版本
 
====================================================================
GetVersionEx VB声明 
Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (ByVal lpVersionInformation As OSVERSIONINFO) As Long 
说明 
在一个OSVERSIONINFO结构中载入与平台和操作系统有关的版本信息 
返回值 
Long,非零表示成功,零表示失败 
参数表 
参数 类型及说明 
lpVersionInformation OSVERSIONINFO,用于装载版本信息的结构。在正式调用函数之前,必须先将这个结构的dwOSVersionInfoSize字段设为结构的大小(148) 
====================================================================
OSVERSIONINFO 类型定义 
Type OSVERSIONINFO ' 148 Bytes
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128 
End Type 
说明 
This structure contains operating system version information. This structure is used with the GetVersionEx function.
 
字段表 
字段 类型与说明 
dwOSVersionInfoSize Long,Size of this data structure, currently at 148 bytes. This field must be set before calling the GetVersionEx function. 
dwMajorVersion Long,Specifies the major and minor version number of the operating system. 
dwMinorVersion 
dwBuildNumber Long,Specifies the build number of the operating system. On Windows 95, build 1000 respresents OEM service release #2. 
dwPlatformId Long,Specifies the platform supported by the operating system. May be one of the following:VER_PLATFORM_WIN32s: Win32s on Windows 3.1.VER_PLATFORM_WIN32_WINDOWS: Win32 on Windows 95.VER_PLATFORM_WIN32_NT: Windows NT. 
szCSDVersion String,Contains additional information about the operating system.