Passing variable to the WindowProcedure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fromethius
    New Member
    • Apr 2007
    • 38

    Passing variable to the WindowProcedure

    Without creating global variables, is there a way to pass variables to the WindowProcedure that handles the messages?

    For example, if I create a variable and initialize it in WinMain, is there any way to use it in my WindowProcedure ?

    What I am doing is this. I have a class called Map. I also have a class called Texture and Window.

    When I create Texture and Window, certain variables are created such as texWidth, texHeight, windowWidth, and WindowHeight inside of the class.

    In my Window Procedure, I need to use those variables held inside of Texture and Window for some function calls.

    Is there any way to do this easily? I would really like to keep it simple and try to avoid global variables if possible.
  • Darryl
    New Member
    • May 2007
    • 86

    #2
    You can use the Windows Property to pass it in if you know the window that will need it or are only using 1 window.

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      You can use the WPARAM and LPARAM of the WindowProc().

      Comment

      Working...