I've developing an app that uses some of the advanced Windows 7 features that werent available on WinXP. Lets say I want to use ChangeWindowMessageFilterEx (or any other calls that were added since Win7), the app compiles and works fine on Win7. But on XP I get "The procedure entry point ChangeWindowMessageFilterEx could not be located in the dynamic link library USER32.dll" BEFORE even the application starts.
Is there any way to run my app on XP without compiling two different versions?
You do that by dynamically resolving ChangeWindowMessageFilterEx
using LoadLibrary
and GetProcAddress
. If GetProcAddress
returns NULL
, you just don't call this function.
See also:
Checking for existence of Windows API Functions
Using Run-Time Dynamic Linking
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With