Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. XP Screensaver and VS2008

XP Screensaver and VS2008

Scheduled Pinned Locked Moved C / C++ / MFC
c++htmlcomsecurityhelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CryoK
    wrote on last edited by
    #1

    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[^]

    F 1 Reply Last reply
    0
    • C CryoK

      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[^]

      F Offline
      F Offline
      fefe wyx
      wrote on last edited by
      #2

      I think you need to use LoadLibrary to load "user32.dll" and user GetProcAddress to get the function ChangeWindowMessageFilter.

      C 1 Reply Last reply
      0
      • F fefe wyx

        I think you need to use LoadLibrary to load "user32.dll" and user GetProcAddress to get the function ChangeWindowMessageFilter.

        C Offline
        C Offline
        CryoK
        wrote on last edited by
        #3

        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.

        F 1 Reply Last reply
        0
        • C CryoK

          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.

          F Offline
          F Offline
          fefe wyx
          wrote on last edited by
          #4

          "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(...), call method(...).

          L 1 Reply Last reply
          0
          • F fefe wyx

            "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(...), call method(...).

            L Offline
            L Offline
            lubbe75
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups