Article View: borland.public.cppbuilder.nativeapi
Article #11903Re: Detecting Windows XP
From: Colin Maharaj
Date: Sat, 10 Jan 2004 17:47
Date: Sat, 10 Jan 2004 17:47
21 lines
1405 bytes
1405 bytes
Fernando wrote:
>
> Hi,
>
> How do I detect windows XP? O:-)
>
> TIA
void MyVersionInfo()
{
OSVERSIONINFO osv;
osv.dwOSVersionInfoSize = sizeof(osv);
GetVersionEx(&osv);
bool IsNT = (osv.dwPlatformId == VER_PLATFORM_WIN32_NT);
//Win32Platform
bool Is2000 = (IsNT && (osv.dwMajorVersion == 5) &&
osv.dwMinorVersion == 0);
bool IsXP = (IsNT && (osv.dwMajorVersion == 5) &&
osv.dwMinorVersion == 1);
}
Technical Details
Message-ID:
<40003AB9.BC3AE8C6@cablenett.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<i3arvvc0p3esp7mlj6rqt3b1s0fs529pgp@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,ce78bf60546b6fb5 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-01-10 10:09:39 PST Message-ID: <40003AB9.BC3AE8C6@cablenett.net> Date: Sat, 10 Jan 2004 13:47:37 -0400 From: Colin Maharaj <cbm@cablenett.net> Reply-To: cbm@cablenett.net X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Detecting Windows XP References: <i3arvvc0p3esp7mlj6rqt3b1s0fs529pgp@4ax.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 196.32.37.67 X-Trace: newsgroups.borland.com 1073757012 196.32.37.67 (10 Jan 2004 09:50:12 -0700) Lines: 21 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail