MyFirstApp.cpp(9,1):** error C4996**: 'GetVersionExW': 被声明为已否决
10.0.17763.0\um\sysinfoapi.h(387): message : 参见“GetVersionExW”的声明
#include<Windows.h>
#include<tchar.h>
#pragma warning(disable: 4996) //目前的vs2019版本,必须加入忽略4996错误方能执行
int WINAPI _tWinMain(HINSTANCE hinstance, HINSTANCE previnstance, LPTSTR lpCmdLine, int nCmdShow)
{
//BOOL GetVersionEx(LPOSVERSIONINFO lpVersionInfo);
OSVERSIONINFO vi = { sizeof(vi) };
GetVersionEx(&vi);
if(vi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
{
MessageBox(NULL, _T("您的系统是windows98系列的操作系统"), _T("提示"), MB_OK);
//CloseHandle(Ret);
}
else
{
//DWORD ERRORNUM = GetLastError();
MessageBox(NULL, _T("您的系统是windowsNT系列操作系统"), _T("提示"), MB_OK);
}
return 0;
}