lparam(LPARAM):Windows 编程(Win32 API)中的一种参数类型,常见于窗口消息处理函数(如 WndProc)。它通常用于在消息中携带附加信息(常为指针或整数),大小与指针相同(在 32/64 位系统上随平台变化)。
/ˌɛlˈpærəm/
The message handler reads the value from lParam.
消息处理函数从 lParam 中读取这个值。
In a Win32 window procedure, lParam often packs two 16-bit values or stores a pointer, depending on the message type.
在 Win32 窗口过程函数中,lParam 经常把两个 16 位的值打包在一起,或根据消息类型用来存放一个指针。
LPARAM 来自 Windows API 的命名习惯:一般解释为 “Long Parameter”(长整型参数),用于表示“消息参数中的长整型/指针大小数据”。它并非普通英语词汇,而是 C/C++ Windows 编程中的类型名(typedef)。
WndProc 时大量出现 WPARAM/LPARAM。LPARAM。WindowProc/SendMessage 文档)——作为参数类型标准出现。