Windows 10 VersionHelper.h  


  1. Posts : 1
    windows 10
       #1

    Windows 10 VersionHelper.h


    I need to store the version of Windows running on the client computer in a variable. I'm having problems with VersionHelper.h, machines that are using Windows 10 appears as Windows 8, how do I fix this?

    I'm using Visual Studio 2015, Target Platform Version: 10.0.10586.0
    HTML Code:
    if (IsWindows7SP1OrGreater())
    {
        strcpy_s(this->OS_Detect, "Windows 7 SP1");
    }
    
    if (IsWindows8OrGreater())
    {
        strcpy_s(this->OS_Detect, "Windows 8");
    }
    
    if (IsWindows8Point1OrGreater())
    {
        strcpy_s(this->OS_Detect, "Windows 8.1");
    }
    
    if (IsWindows10OrGreater())
    {
        strcpy_s(this->OS_Detect, "Windows 10");
    }
    return of machines with windows 10 = "Windows 8"
    I need more clarity, any help here is appreciated..

    Thanks
    Siva Prasad
    src:stackoverflow
      My Computer


  2. Posts : 14,006
    Windows 10 Pro X64 21H1 19043.1503
       #2

    That's a programming bug. Windows 10 is greater than Window 8 so that statement is true. You need to reverse the choices, 10, 8.1, 8, 7 and it should work okay.
      My Computers


  3. Posts : 809
    Win10
       #3

    Ztruker said:
    That's a programming bug. Windows 10 is greater than Window 8 so that statement is true. You need to reverse the choices, 10, 8.1, 8, 7 and it should work okay.
    The OP isn't using else-if so the code should work as written.

    However, the IsWindows8Point1OrGreater() and IsWindows10OrGreater() APIs have a caveat for Win10: IsWindows10OrGreater function | Microsoft Docs

    Applications not manifested for Windows 10 return false, even if the current operating system version is Windows 10. To manifest your applications for Windows 10, see Targeting your application for Windows.
      My Computer


  4. Posts : 14,006
    Windows 10 Pro X64 21H1 19043.1503
       #4

    I don't understand what this means? I looked it up but still don't really understand. Something about an XML file that gets bound to something or other.

    I guess it doesn't matter as long as sivaprasad222 understands what you mean.
      My Computers


 

Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 22:43.
Find Us




Windows 10 Forums