I’ve developed a application which uses Vista (or higher) API’s and i would like to add a popup message if the application detects a unsupported OS.
I would like to add a popup message when a user runs my application on windows XP. Currently the application just throws a popup(messageBox) saying that some DLL’s can’t be loaded.
I’ve defined the windows version like this:
#define _WIN32_WINNT 0x0600
What do i have to do to prevent from running on versions lower than Vista? Do i have to check the OS version when the application starts (and show a message to the user)?
In order to show a popup message, you need to run the executable. That means that you have to reduce your windows version to the lowest one you intend to ‘support’ (support here meaning be able to run at, and show a popup saying that it won’t run). That would require you to delay the point were you link to your relevant DLLs, otherwise they won’t be found and you would still get the same message box you do know.
All in all, there are numerous drawbacks with this approach since you have to build a valid executable both at XP as well as Vista. If you really need this check, then you could have one executable do it and decide whether to show a popup message or start your actual application (in a different executable).