Results 1 to 2 of 2

Thread: Passing variable to the WindowProcedure

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    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.

  2. #2
    Addicted Member Kal-El's Avatar
    Join Date
    Jun 2007
    Location
    Fortress of solitude
    Posts
    179

    Re: Passing variable to the WindowProcedure

    yes you can! Like the said to you here, you need to use the last param of CreateWindowEx.

    «Source Code»«plugins»«skin»«fav apps»«Winamp en español»«Nsis en español»
    So what if your signature move is driving a tractor? I think it's adorable. - Lois ("Crimson")
    Don't forget to when your question is resolved ...and the people who help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width