XP Screensaver and VS2008
-
Hi all, I'm busy trying to create a screensaver in VS2008 (using C++). The screensaver works fine in Vista, but when in XP it gives me an error message of "The procedure entry point ChangeWindowMessageFilter could not be located in the dynamic link library USER32.dll". According to Bradwich[^], "To allow your program to run on both XP and Vista, you need to retrieve the pointer to the ChangeWindowMessageFilter function dynamically instead of importing it at compile time". I have absolutely no clue how to do this, as I'm still new to C++. Does anyone know how to do this? Thank you. PS: I'm using the "framework" from How to Scr[^]
-
Hi all, I'm busy trying to create a screensaver in VS2008 (using C++). The screensaver works fine in Vista, but when in XP it gives me an error message of "The procedure entry point ChangeWindowMessageFilter could not be located in the dynamic link library USER32.dll". According to Bradwich[^], "To allow your program to run on both XP and Vista, you need to retrieve the pointer to the ChangeWindowMessageFilter function dynamically instead of importing it at compile time". I have absolutely no clue how to do this, as I'm still new to C++. Does anyone know how to do this? Thank you. PS: I'm using the "framework" from How to Scr[^]
-
I think you need to use
LoadLibrary
to load "user32.dll" and userGetProcAddress
to get the function ChangeWindowMessageFilter.Thanks for the response :) I got as far as:
HMODULE library = LoadLibrary("User32.dll");
FARPROC method = GetProcAddress(library, "ChangeWindowMessageFilter");
//somehow tell my program to use the retrieved method/function
FreeLibrary(library);I don't know how to actually tell the program to use the retrieved method/function. Could someone show me how to that please? Thank you.
-
Thanks for the response :) I got as far as:
HMODULE library = LoadLibrary("User32.dll");
FARPROC method = GetProcAddress(library, "ChangeWindowMessageFilter");
//somehow tell my program to use the retrieved method/function
FreeLibrary(library);I don't know how to actually tell the program to use the retrieved method/function. Could someone show me how to that please? Thank you.
-
"method" is a function pointer. You should cast it to a function pointer type that is the same as ChangeWindowMessageFilter. Then, instead of calling
ChangeWindowMessageFilter(...)
, callmethod(...)
.Hi! I realise that this is an old topic. Sorry, I don't quite understand this. In my screensaver I never use ChangeWindowMessageFilter... but I still get the error. Can someone explain why this happens? Also, can someone confirm that the previous suggestion works? How exactly do I do the casting and where should this call be made? Thanks in advance.