<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Windowsversion herausfinden]]></title><description><![CDATA[<p>Hallo Community!</p>
<p>Gibt es eine Funktion mit der ich herausfinden kann ob das Betriebssystem auf dem mein Programm ausgeführt wird &quot;&lt; XP&quot; oder &quot;Vista&lt;&quot; ist?<br />
Ich habe schon bei Google gesucht, und das Beispiel von Microsoft gesehen, aber so genau brauche ich es ja garnicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> !</p>
<p>Danke im Vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/216486/windowsversion-herausfinden</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 06:02:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/216486.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Jun 2008 17:20:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Windowsversion herausfinden on Tue, 24 Jun 2008 17:20:07 GMT]]></title><description><![CDATA[<p>Hallo Community!</p>
<p>Gibt es eine Funktion mit der ich herausfinden kann ob das Betriebssystem auf dem mein Programm ausgeführt wird &quot;&lt; XP&quot; oder &quot;Vista&lt;&quot; ist?<br />
Ich habe schon bei Google gesucht, und das Beispiel von Microsoft gesehen, aber so genau brauche ich es ja garnicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> !</p>
<p>Danke im Vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1534963</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1534963</guid><dc:creator><![CDATA[-+-+-+-]]></dc:creator><pubDate>Tue, 24 Jun 2008 17:20:07 GMT</pubDate></item><item><title><![CDATA[Reply to Windowsversion herausfinden on Tue, 24 Jun 2008 17:23:19 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/ms724451.aspx" rel="nofollow">GetVersionEx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1534966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1534966</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Tue, 24 Jun 2008 17:23:19 GMT</pubDate></item><item><title><![CDATA[Reply to Windowsversion herausfinden on Tue, 24 Jun 2008 17:28:38 GMT]]></title><description><![CDATA[<p>Wenn ich das richtig verstanden habe, dann muss ich mit aus OSVERSIONINFO dwMajorVersion auslesen und bei 5 is &lt;XP und bei 6 Vista&lt;, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1534974</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1534974</guid><dc:creator><![CDATA[-+-+-+-]]></dc:creator><pubDate>Tue, 24 Jun 2008 17:28:38 GMT</pubDate></item><item><title><![CDATA[Reply to Windowsversion herausfinden on Tue, 24 Jun 2008 17:38:26 GMT]]></title><description><![CDATA[<p>5.00 - Windows 2000<br />
5.10 - Windows XP<br />
6.00 - Windows Vista</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1534987</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1534987</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Tue, 24 Jun 2008 17:38:26 GMT</pubDate></item><item><title><![CDATA[Reply to Windowsversion herausfinden on Tue, 24 Jun 2008 17:54:25 GMT]]></title><description><![CDATA[<p>und: 6.00 =&gt; Windows Server 2008</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1534996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1534996</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 24 Jun 2008 17:54:25 GMT</pubDate></item><item><title><![CDATA[Reply to Windowsversion herausfinden on Wed, 25 Jun 2008 10:10:04 GMT]]></title><description><![CDATA[<p>sri schrieb:</p>
<blockquote>
<p>5.10 - Windows XP</p>
</blockquote>
<p>Die Zahl 10 ist falsch, korrekt wäre 1, also 5.1</p>
<p>Nun um Dein Programm &quot;wasserdichter&quot; zu machen solltest Du unbedingt zuallererst die Member-Variable dwPlatformId von GetVersionEx() auswerten!<br />
Faustregel was Rangfolge der Priorität bei der Auswertung betrifft:<br />
1.) dwPlatformId<br />
2.) dwMajorVersion<br />
3.) dwMinorVersion</p>
<p>Wenn <strong>dwPlatformId == VER_PLATFORM_WIN32_NT</strong>, dann gelten für dwMajorVersion.dwMinorVersion folgende:<br />
4.0 - Windows NT 4.0 (bis inkl. SP6a)<br />
5.0 - Windows 2000 (bis inkl. SP4)<br />
5.1 - Windows XP (bis inkl. SP3)<br />
5.2 - Windows Server 2003, Windows Home Server und Windows XP x64 (bis inkl. SP2)<br />
6.0 - Windows Vista und Windows Server 2008 (bis inkl. SP1)</p>
<p>Man beachte, daß Windows XP und Windows XP x64 unterschiedliche Versionsnummern haben!</p>
<p>Andere derzeit bekannte Werte für dwPlatformId sind:<br />
VER_PLATFORM_WIN32s (das ist Windows 1.x / 2.x / 3.x)<br />
VER_PLATFORM_WIN32_WINDOWS (das ist Windows 95 / 98 / Me)<br />
VER_PLATFORM_WIN32_CE (das ist Windows CE oder Windows Mobile)</p>
<p>Übrigens, für den Vista Nachfolger (Codename &quot;Vienna&quot;) gibt es nach meinen Vermutungen folgende Möglichkeiten:<br />
a) dwPlatformId == VER_PLATFORM_WIN32_NT mit dwMajorVersion.dwMinorVersion 6.1<br />
b) dwPlatformId == VER_PLATFORM_WIN32_NT mit dwMajorVersion.dwMinorVersion 7.0<br />
c) dwPlatformId == VER_PLATFORM_WIN32_xxx mit dwMajorVersion.dwMinorVersion x.x (wobei VER_PLATFORM_WIN32_xxx eine neue ID zugewiesen wird)<br />
Ich persönlich tippe eher auf Möglichkeit a)</p>
<p>Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1535402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1535402</guid><dc:creator><![CDATA[Mmacher]]></dc:creator><pubDate>Wed, 25 Jun 2008 10:10:04 GMT</pubDate></item><item><title><![CDATA[Reply to Windowsversion herausfinden on Wed, 25 Jun 2008 10:39:26 GMT]]></title><description><![CDATA[<p>Mmacher schrieb:</p>
<blockquote>
<p>sri schrieb:</p>
<blockquote>
<p>5.10 - Windows XP</p>
</blockquote>
<p>Die Zahl 10 ist falsch, korrekt wäre 1, also 5.1</p>
</blockquote>
<p>Stimmt. Sorry für die Fehlinformation. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Mmacher schrieb:</p>
<blockquote>
<p>Übrigens, für den Vista Nachfolger (Codename &quot;Vienna&quot;) gibt es nach meinen Vermutungen folgende Möglichkeiten:<br />
a) dwPlatformId == VER_PLATFORM_WIN32_NT mit dwMajorVersion.dwMinorVersion 6.1<br />
b) dwPlatformId == VER_PLATFORM_WIN32_NT mit dwMajorVersion.dwMinorVersion 7.0<br />
c) dwPlatformId == VER_PLATFORM_WIN32_xxx mit dwMajorVersion.dwMinorVersion x.x (wobei VER_PLATFORM_WIN32_xxx eine neue ID zugewiesen wird)<br />
Ich persönlich tippe eher auf Möglichkeit a)</p>
</blockquote>
<p>Halte dagegen. Da auch MS immer von &quot;Windows 7&quot; spricht, ist für mich b) wahrscheinlicher. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1535435</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1535435</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Wed, 25 Jun 2008 10:39:26 GMT</pubDate></item><item><title><![CDATA[Reply to Windowsversion herausfinden on Mon, 14 Jul 2008 23:20:11 GMT]]></title><description><![CDATA[<p>was für ein komplizierter mist das hätte man auch einfacher machen können Windoof</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1547420</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1547420</guid><dc:creator><![CDATA[Urshak]]></dc:creator><pubDate>Mon, 14 Jul 2008 23:20:11 GMT</pubDate></item><item><title><![CDATA[Reply to Windowsversion herausfinden on Mon, 14 Jul 2008 23:37:32 GMT]]></title><description><![CDATA[<pre><code>#include &lt;windows.h&gt;
#include &lt;tchar.h&gt;
#include &lt;stdio.h&gt;
#include &lt;strsafe.h&gt;

#define BUFSIZE 256

typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD);

BOOL GetOSDisplayString( LPTSTR pszOS)
{
   OSVERSIONINFOEX osvi;
   SYSTEM_INFO si;
   PGNSI pGNSI;
   PGPI pGPI;
   BOOL bOsVersionInfoEx;
   DWORD dwType;

   ZeroMemory(&amp;si, sizeof(SYSTEM_INFO));
   ZeroMemory(&amp;osvi, sizeof(OSVERSIONINFOEX));

   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);

   if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &amp;osvi)) )
      return 1;

   // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise.

   pGNSI = (PGNSI) GetProcAddress(
      GetModuleHandle(TEXT(&quot;kernel32.dll&quot;)), 
      &quot;GetNativeSystemInfo&quot;);
   if(NULL != pGNSI)
      pGNSI(&amp;si);
   else GetSystemInfo(&amp;si);

   if ( VER_PLATFORM_WIN32_NT==osvi.dwPlatformId &amp;&amp; 
        osvi.dwMajorVersion &gt; 4 )
   {
      StringCchCopy(pszOS, BUFSIZE, TEXT(&quot;Microsoft &quot;));

      // Test for the specific product.

      if ( osvi.dwMajorVersion == 6 &amp;&amp; osvi.dwMinorVersion == 0 )
      {
         if( osvi.wProductType == VER_NT_WORKSTATION )
             StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Windows Vista &quot;));
         else StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Windows Server 2008 &quot; ));

         pGPI = (PGPI) GetProcAddress(
            GetModuleHandle(TEXT(&quot;kernel32.dll&quot;)), 
            &quot;GetProductInfo&quot;);

         pGPI( 6, 0, 0, 0, &amp;dwType);

         switch( dwType )
         {
            case PRODUCT_ULTIMATE:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Ultimate Edition&quot; ));
               break;
            case PRODUCT_HOME_PREMIUM:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Home Premium Edition&quot; ));
               break;
            case PRODUCT_HOME_BASIC:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Home Basic Edition&quot; ));
               break;
            case PRODUCT_ENTERPRISE:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Enterprise Edition&quot; ));
               break;
            case PRODUCT_BUSINESS:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Business Edition&quot; ));
               break;
            case PRODUCT_STARTER:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Starter Edition&quot; ));
               break;
            case PRODUCT_CLUSTER_SERVER:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Cluster Server Edition&quot; ));
               break;
            case PRODUCT_DATACENTER_SERVER:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Datacenter Edition&quot; ));
               break;
            case PRODUCT_DATACENTER_SERVER_CORE:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Datacenter Edition (core installation)&quot; ));
               break;
            case PRODUCT_ENTERPRISE_SERVER:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Enterprise Edition&quot; ));
               break;
            case PRODUCT_ENTERPRISE_SERVER_CORE:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Enterprise Edition (core installation)&quot; ));
               break;
            case PRODUCT_ENTERPRISE_SERVER_IA64:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Enterprise Edition for Itanium-based Systems&quot; ));
               break;
            case PRODUCT_SMALLBUSINESS_SERVER:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Small Business Server&quot; ));
               break;
            case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Small Business Server Premium Edition&quot; ));
               break;
            case PRODUCT_STANDARD_SERVER:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Standard Edition&quot; ));
               break;
            case PRODUCT_STANDARD_SERVER_CORE:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Standard Edition (core installation)&quot; ));
               break;
            case PRODUCT_WEB_SERVER:
               StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Web Server Edition&quot; ));
               break;
         }
         if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 )
            StringCchCat(pszOS, BUFSIZE, TEXT( &quot;, 64-bit&quot; ));
         else if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_INTEL )
            StringCchCat(pszOS, BUFSIZE, TEXT(&quot;, 32-bit&quot;));
      }

      if ( osvi.dwMajorVersion == 5 &amp;&amp; osvi.dwMinorVersion == 2 )
      {
         if( GetSystemMetrics(SM_SERVERR2) )
            StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Windows Server 2003 R2, &quot;));
         else if ( osvi.wSuiteMask==VER_SUITE_STORAGE_SERVER )
            StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Windows Storage Server 2003&quot;));
         else if( osvi.wProductType == VER_NT_WORKSTATION &amp;&amp;
                  si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
         {
            StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Windows XP Professional x64 Edition&quot;));
         }
         else StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Windows Server 2003, &quot;));

         // Test for the server type.
         if ( osvi.wProductType != VER_NT_WORKSTATION )
         {
            if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64 )
            {
                if( osvi.wSuiteMask &amp; VER_SUITE_DATACENTER )
                   StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Datacenter Edition for Itanium-based Systems&quot; ));
                else if( osvi.wSuiteMask &amp; VER_SUITE_ENTERPRISE )
                   StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Enterprise Edition for Itanium-based Systems&quot; ));
            }

            else if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 )
            {
                if( osvi.wSuiteMask &amp; VER_SUITE_DATACENTER )
                   StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Datacenter x64 Edition&quot; ));
                else if( osvi.wSuiteMask &amp; VER_SUITE_ENTERPRISE )
                   StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Enterprise x64 Edition&quot; ));
                else StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Standard x64 Edition&quot; ));
            }

            else
            {
                if ( osvi.wSuiteMask &amp; VER_SUITE_COMPUTE_SERVER )
                   StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Compute Cluster Edition&quot; ));
                else if( osvi.wSuiteMask &amp; VER_SUITE_DATACENTER )
                   StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Datacenter Edition&quot; ));
                else if( osvi.wSuiteMask &amp; VER_SUITE_ENTERPRISE )
                   StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Enterprise Edition&quot; ));
                else if ( osvi.wSuiteMask &amp; VER_SUITE_BLADE )
                   StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Web Edition&quot; ));
                else StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Standard Edition&quot; ));
            }
         }
      }

      if ( osvi.dwMajorVersion == 5 &amp;&amp; osvi.dwMinorVersion == 1 )
      {
         StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Windows XP &quot;));
         if( osvi.wSuiteMask &amp; VER_SUITE_PERSONAL )
            StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Home Edition&quot; ));
         else StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Professional&quot; ));
      }

      if ( osvi.dwMajorVersion == 5 &amp;&amp; osvi.dwMinorVersion == 0 )
      {
         StringCchCat(pszOS, BUFSIZE, TEXT(&quot;Windows 2000 &quot;));

         if ( osvi.wProductType == VER_NT_WORKSTATION )
         {
            StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Professional&quot; ));
         }
         else 
         {
            if( osvi.wSuiteMask &amp; VER_SUITE_DATACENTER )
               StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Datacenter Server&quot; ));
            else if( osvi.wSuiteMask &amp; VER_SUITE_ENTERPRISE )
               StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Advanced Server&quot; ));
            else StringCchCat(pszOS, BUFSIZE, TEXT( &quot;Server&quot; ));
         }
      }

       // Include service pack (if any) and build number.

      if( _tcslen(osvi.szCSDVersion) &gt; 0 )
      {
          StringCchCat(pszOS, BUFSIZE, TEXT(&quot; &quot;) );
          StringCchCat(pszOS, BUFSIZE, osvi.szCSDVersion);
      }

      TCHAR buf[80];

      StringCchPrintf( buf, 80, TEXT(&quot; (build %d)&quot;), osvi.dwBuildNumber);
      StringCchCat(pszOS, BUFSIZE, buf);

      return TRUE; 
   }

   else
   {
      printf( &quot;This sample does not support this version of Windows.\n&quot;);
      return FALSE;
   }
}

int __cdecl _tmain()
{
    TCHAR szOS[BUFSIZE];

    if( GetOSDisplayString( szOS ) )
        _tprintf( TEXT(&quot;\n%s\n&quot;), szOS );
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1547424</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1547424</guid><dc:creator><![CDATA[Urshak]]></dc:creator><pubDate>Mon, 14 Jul 2008 23:37:32 GMT</pubDate></item></channel></rss>