术语 | getversion |
释义 | GetVersion 语法: C++ DWORD WINAPI GetVersion(void); GetVersion函数 检索当前操作系统的版本号。 注意:此功能已被取代GetVersionEx。新的应用程序应该使用GetVersionEx或VerifyVersionInfo。 参数 这个函数没有参数。 返回值 如果函数成功,返回值包括在低位字的操作系统主要和次要版本号,以及有关在高位字的操作系统平台上的信息。 对于所有平台,低位字包含操作系统的版本号。低这个词的顺序字节指定了主版本号,十六进制表示法。在高字节指定次要版本(修订版)以16进制数。高序位是零,未来7位表示版本号,而低位字节为5。 备注 该GetVersionEx功能的开发,因为许多现有的应用程序出错时,检查包装DWORD值返回GetVersion,移调主要和次要版本号。 GetVersionEx部队应用,明确检查每个元素的版本信息。 VerifyVersionInfo进一步消除潜在的错误进行比较,与您当前系统版本所需的系统版本。 实例 The following code fragment illustrates how to extract information from the GetVersion return value: #include #include void main() { DWORD dwVersion = 0; DWORD dwMajorVersion = 0; DWORD dwMinorVersion = 0; DWORD dwBuild = 0; dwVersion = GetVersion(); // Get the Windows version. dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); // Get the build number. if (dwVersion < 0x80000000) dwBuild = (DWORD)(HIWORD(dwVersion)); printf("Version is %d.%d (%d)\\n", dwMajorVersion, dwMinorVersion, dwBuild); } 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 GetVersionEx 操作系统版本 系统信息功能 VerifyVersionInfo 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==GetVersion Function Retrieves the version number of the current operating system. Note This function has been superseded by GetVersionEx . New applications should use GetVersionEx or VerifyVersionInfo . Syntax C++ DWORD WINAPI GetVersion(void); Parameters This function has no parameters. Return Value If the function succeeds, the return value includes the major and minor version numbers of the operating system in the low-order word, and information about the operating system platform in the high-order word. For all platforms, the low-order word contains the version number of the operating system. The low-order byte of this word specifies the major version number, in hexadecimal notation. The high-order byte specifies the minor version (revision) number, in hexadecimal notation. The high-order bit is zero, the next 7 bits represent the build number, and the low-order byte is 5. Remarks The GetVersionEx function was developed because many existing applications err when examining the packed DWORD value returned by GetVersion, transposing the major and minor version numbers. GetVersionEx forces applications to explicitly examine each element of version information. VerifyVersionInfo eliminates further potential for error by comparing the required system version with the current system version for you. Examples The following code fragment illustrates how to extract information from the GetVersion return value: #include #include void main() { DWORD dwVersion = 0; DWORD dwMajorVersion = 0; DWORD dwMinorVersion = 0; DWORD dwBuild = 0; dwVersion = GetVersion(); // Get the Windows version. dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); // Get the build number. if (dwVersion < 0x80000000) dwBuild = (DWORD)(HIWORD(dwVersion)); printf("Version is %d.%d (%d)\\n", dwMajorVersion, dwMinorVersion, dwBuild); } Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also GetVersionEx Operating System Version System Information Functions VerifyVersionInfo Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms724439(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。