Reputation: 659
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?
Upvotes: 4
Views: 1047
Reputation: 78174
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
Upvotes: 8