WPARAM和LPARAM

来自http://tunps.com/wparam-lparam

c:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\WinDef.h(183)

/* Types use for passing & returning polymorphic values */
typedef UINT_PTR            WPARAM;
typedef LONG_PTR            LPARAM;
typedef LONG_PTR            LRESULT;

UINT_PTR

typedef _W64 unsigned int UINT_PTR, *PUINT_PTR;
typedef [public] unsigned __int3264 UINT_PTR, *PUINT_PTR;
typedef unsigned __int64 UINT_PTR, *PUINT_PTR;

LONG_PTR

typedef _W64 long LONG_PTR, *PLONG_PTR;
typedef [public] __int3264 LONG_PTR, *PLONG_PTR;
typedef __int64 LONG_PTR, *PLONG_PTR;

虽然有不同的条件编译,但是总的来说,WPARAM是unsigned int,LPARAM是long

不通的平台(32bit/64bit)有不同的长度。

参见msdn的Data Type Ranges

在32bit windows xp,visual studio 2010下:

sizeof(WPARAM)	0x00000004	unsigned int
sizeof(LPARAM)	0x00000004	unsigned int

About tunpishuang

just 4 fun·····
This entry was posted in 未分类. Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>