DWORD dwVersion = GetVersion();
// DWORD dwBuild;
// Get major and minor version numbers of Windows
DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
// Get build numbers for Windows NT or Win32s
if(dwWindowsMajorVersion > 5 || (dwWindowsMajorVersion == 5 && dwWindowsMinorVersion > 0)) //winxp
{
}请问dwWindowsMajorVersion这个值是如何分布的?
当为WIN98==? WIN2000==? WINNT==? WINME==?
// DWORD dwBuild;
// Get major and minor version numbers of Windows
DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
// Get build numbers for Windows NT or Win32s
if(dwWindowsMajorVersion > 5 || (dwWindowsMajorVersion == 5 && dwWindowsMinorVersion > 0)) //winxp
{
}请问dwWindowsMajorVersion这个值是如何分布的?
当为WIN98==? WIN2000==? WINNT==? WINME==?
解决方案 »
- 其他进程中如何控制IME拼音输入法退出
- FillRect函数功能:该函数用指定的画刷填充矩形,此函数包括矩形的左上边界,但不包括矩形的右下边界。
- 如何在MFC中使用CDatabase和CRecordset时,设置查询返回的行数??有正文
- 请教远程COM与本地COM的区别,如何创建和布署一个远程COM?
- 连在internet上的两台计算机如何建立socket连接?
- 怎样设置鼠标忙的状态?
- 如何判断打印机是否处于联机或者可用状态!
- 如何在一个dialog里调用另一个dialog中checkbox(或combobox)的值?
- vc中如何实现声音文件播放?
- 进程内和进程外的区别
- 或许是我孤陋寡闻
- 已知:html数据,CDC * pDC。如何把html画到pDC上,只使用pDC的函数接口
这个我用过,但记不住,
The GetVersionEx function obtains extended information about the version of the operating system that is currently running.Windows 2000: To compare the current system version to a required version, use the VerifyVersionInfo function instead of using GetVersionEx to perform the comparison yourself. BOOL GetVersionEx(
LPOSVERSIONINFO lpVersionInfo // version information
);
Parameters
lpVersionInfo
[in/out] Pointer to an OSVERSIONINFO data structure that the function fills with operating system version information.
Before calling the GetVersionEx function, set the dwOSVersionInfoSize member of the OSVERSIONINFO data structure to sizeof(OSVERSIONINFO). Windows 2000: This member can be a pointer to an OSVERSIONINFOEX structure. Set the dwOSVersionInfoSize member to sizeof(OSVERSIONINFOEX) to identify the structure type. Return Values
If the function succeeds, the return value is a nonzero value.If the function fails, the return value is zero. To get extended error information, call GetLastError. The function fails if you specify an invalid value for the dwOSVersionInfoSize member of the OSVERSIONINFO or OSVERSIONINFOEX structure. Res
When using the GetVersionEx function to determine whether your application is running on a particular version of the operating system, check for version numbers that are greater than or equal to the desired version numbers. This ensures that the test succeeds for later versions of the operating system. For example, if your application requires Windows 98, use the following test:osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO)
GetVersionEx (&osvi);
bIsWindows98orLater =
(osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) &&
( (osvi.dwMajorVersion > 4) ||
( (osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion > 0) ) );
Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using GetVersionEx to determine the operating system platform or version number, test for the presence of the feature itself. For more information, see Operating System Version.
Windows NT 3.51 0 Build number 3
Windows NT 4.0 0 Build number 4
Windows 2000 or Whistler 0 Build number 5
Windows 95, Windows 98, or Windows Me 1 Reserved 4
Win32s with Windows 3.1 1 Build number 3
dwVersion = GetVersion();
// Get the Windows version.dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));// Get the build number.if (dwVersion < 0x80000000) // Windows NT/2000, Whistler
dwBuild = (DWORD)(HIWORD(dwVersion));
else if (dwWindowsMajorVersion < 4) // Win32s
dwBuild = (DWORD)(HIWORD(dwVersion) & ~0x8000);
else // Windows 95/98/Me
dwBuild = 0;