Hi!
I need to know if there is a way in borland C++ to tell the windows version under which a C++ program is running.
I found a command _version that provides the DOS version but nothing to tell the windows version. Can you help?
Thanks!
Hi!
I need to know if there is a way in borland C++ to tell the windows version under which a C++ program is running.
I found a command _version that provides the DOS version but nothing to tell the windows version. Can you help?
Thanks!
You could use GetOsVersionEx()
I have had to do the exact same thing for apps since XP came out because even though you specify the same size, the window is a different size on an XP screen than a 98 screen (depending on how you create your window of course).
Code:#define WINXP_MAJOR_VERSION 5 OSVERSIONINFO osvi = {0}; osvi.dwOSVersionInfoSize = sizeof(osvi); GetVersionEx((OSVERSIONINFO*)&osvi); if (osvi.dwMajorVersion < WINXP_MAJOR_VERSION) //then it is before XP else //it is at least XP
Thanks for the replies but those functions (GetVersionEx and GetOsVersionEx) are not part of the Borland C++ library. I have a very old version of borland C++ (3.1) and I don't know if anyone can help with this.
Just look at _osmajor (and _osminor if need be). If _osmajor is < 5 it is before XP.