I have a legacy VB6 application where I'm trying to look up the OS that is running on the machine using the OSVERIONINFOEX function. When the application is run out of IDE, it's telling me that my OS is XP Major Version = 5 and Minor Version = 1, however, when it's run from the executable it tells me that the OS is Windows 8, but it's actually Windows 10. I have not updated the code to Windows 10 but is there a reason why it's giving me two different results why it's doing that?
Asked
Active
Viewed 442 times
1
-
1Well as for 8 vs 10 https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx explains that. But as for it reporting a different version between the ide and running normally, not sure, a compatibility mode thing, maybe? – Jason C Oct 12 '16 at 13:30
-
2getwindowsversion is deprecated: Vb6 runs with campatibility settings and if your application doesn't contain a Win10-compatibility-manifest an older version is returned. – MrTux Oct 12 '16 at 13:30
1 Answers
1
I suspect that the VB6 IDE is running with certain compatibility flags set, so it thinks the OS is XP, which your program (running from the IDE) then also sees. Outside the IDE the .EXE runs alone and then there may be no such flags or different flags.

Peter B
- 22,460
- 5
- 32
- 69
-
A lot of people mistakenly apply a version-lie appcompat shim to VB6.EXE, typically via one of the "compatibility mode" packages they can set on it via Explorer Properties. You don't need that even on Windows 10 though there are a few shims you would want such as `RunAsAdmin` and `VirtualizeDesktopPainting`. – Bob77 Oct 13 '16 at 15:26