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版本