When passing a value to a function that takes both a WPARAM and a LPARAM parameter, does it matter on which of them I pass it? Someone told me that if I use Windows x64 I should use WPARAM; is this true?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When sending messages,
WPARAMandLPARAMparameters have specific interpretations depending on the message. You need to pass those parameters in the way that the message that you are sending expects them to be passed. If you are defining your own message (perhaps via an offset fromWM_USER,WM_APP, orRegisterWindowMessage), then you obviously have a bit more latitude.In the days of 16-bit Windows, a
WPARAMwas a 16-bit word, whileLPARAMwas a 32-bit long. These distinctions went away in Win32; they both became 32-bit values.According to this,
LPARAMis defined asLONG_PTR, which in 64-bit Windows is a signed, 64-bit value.WPARAMis defined asUINT_PTR, which in 64-bit Windows is an unsigned, 64-bit value. If you are defining your own message, you might want to assign its parameters accordingly.