What are the definitions for LPARAM and WPARAM?

后端 未结 6 543
暗喜
暗喜 2020-11-29 03:00

I know I\'m being lazy here and I should trawl the header files for myself, but what are the actual types for LPARAM and WPARAM parameters? Are they pointers, or four byte i

6条回答
  •  既然无缘
    2020-11-29 03:49

    These typedefs go back to the 16-bit days. Originally, LPARAM was a long (signed 32-bit) and WPARAM was a WORD (unsigned 16-bit), hence the W and L. Due to the common practice of passing casted pointers as message parameters, WPARAM was expanded to 32 bits on Win32, and both LPARAM and WPARAM were expanded to 64 bits on Win64.

    In C#, you should use IntPtr for LPARAM and UIntPtr for WPARAM.

    Note that despite the LP prefix, LPARAM is not a far pointer to an ARAM.

提交回复
热议问题