I am writing an app which will remove some Registry keys recursively using API RegDeleteKey or RegDeleteKeyEx. What is bothering me is that RegDeleteKeyEx is not defined for less than XP x64 Professional, so now this limitation is limiting my app. Is there any way in which I can use both APIs with compatibility from XP x86 to Win7 x64 ?
Share
In order for your app to run in old systems where
RegDeleteKeyExdoes not exist, you need to avoid static linking to this API. That is, you don’t use this function directly, adn instead you obtain its pointer on runtime viaGetProcAddress. If it succeeds, then the API is available and you can use it (alternatively you can check OS version).Have a look here: How can I use RegDeleteKeyEx:
RegDeleteKeycan be used directly since it exists in all target platforms.