the third and fourth parameters to WndProc are defined as WPARAM and LPARAM, respectively. The origin of these names requires a bit of history. When Windows was a 16-bit system, the third parameter to WndProc was defined as a WORD, which was a 16-bit unsigned short integer, and the fourth parameter was defined as a LONG, which was a 32-bit signed long integer. That's the reason for the "W" and "L" prefixes on the word "PARAM." In the 32-bit versions of Windows, however, WPARAM is defined as a UINT and LPARAM is defined as a LONG (which is still the C long data type), so both parameters to the window procedure are 32-bit values. This may be a little confusing because the WORD data type is still defined as a 16-bit unsigned short integer in Windows 98, so the "W" prefix to "PARAM" creates somewhat of a misnomer.
LPARAM&WPARAM' History
最新推荐文章于 2026-06-24 19:16:15 发布
本文介绍了Windows消息处理函数WndProc中WPARAM与LPARAM参数的历史由来。早期16位系统中,这两个参数分别对应16位和32位的数据类型,而在现代32位及64位系统中,它们均为32位数据类型。文章还解释了'W'和'L'前缀的含义。

566

被折叠的 条评论
为什么被折叠?



