4 ms·
Sure but in the non-game software world we'd do a runtime check to see if the OS was Vista or later and fallback if not.
by ChrisSD 8y ago
Sure but in the non-game software world we'd do a runtime check to see if the OS was Vista or later and fallback if not.
- user5994461 8y agoYou can't do it as a runtime check. You have to compile the software with the flags to import and link to the latest windows library. The program will hard crash if run on an older version. I just tried to use the API. I literally couldn't find a working example on the internet in 2 hours so I guess noone figured it out in a decade. Wrote https://stackoverflow.com/a/54499257/5994461 https://stackoverflow.com/a/54499257/5994461
- ChrisSD 8y agoWhat's wrong with calling IsWindowsVistaOrGreater[0]? [0] https://docs.microsoft.com/en-us/windows/desktop/api/versionhelpers/nf-versionhelpers-iswindowsvistaorgreater https://docs.microsoft.com/en-us/windows/desktop/api/version...
- user5994461 8y agoYou won't have the chance to call anything. If the executable is statistically linked to the latest API, the executable won't be able to load on older systems. I'm surprised that these new IsWindows...() functions claim compatibility down to Windows 2000. Doubt microsoft knew how they would name their next release 20 years ago. A Google search indicates that they are in fact broken.
- ChrisSD 8y agoYou won't be able to compile with the function imported using the modern lib (because it doesn't exist on XP) but you can conditionally link it at runtime with LoadLibrary/GetProcAddress. If IsWindows... doesn't work then you can use the VerifyVersionInfo function directly.