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 ints? I'm doing some C# interop code and want to be sure I get it working on x64 systems.
In the days of 16-bit Windows, a WPARAM was a 16-bit word, while LPARAM was a 32-bit long. These distinctions went away in Win32; they both became 32-bit values. According to this, LPARAM is defined as LONG_PTR , which in 64-bit Windows is a signed, 64-bit value.
Each message could carry with it two pieces of data, called WPARAM and LPARAM . The first one was a 16-bit value (“word”), so it was called W. The second one was a 32-bit value (“long”), so it was called L. You used the W parameter to pass things like handles and integers.
lParam - Specifies additional message information. The contents of this parameter depend on the value of the uMsg parameter.
LRESULT is an integer value that your program returns to Windows. It contains your program's response to a particular message. The meaning of this value depends on the message code. CALLBACK is the calling convention for the function.
LPARAM
is a typedef for LONG_PTR
which is a long
(signed 32-bit) on win32 and __int64
(signed 64-bit) on x86_64.
WPARAM
is a typedef for UINT_PTR
which is an unsigned int
(unsigned 32-bit) on win32 and unsigned __int64
(unsigned 64-bit) on x86_64.
MSDN link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With