I would like to know what the different value of IntPtr mean. For example, I know that 202 means left button up. Where can I find a list of the values? I am particularly interested in the meaning of 562, 274, and 161. Thanks!
Asked
Active
Viewed 672 times
-1
-
4where did you get that informtion? IntPtr ius a specific data type to be used for pointers in .NET, saying that IntPtr value 202 means left button, without any context, is not true in itself unlesss you explain why and in how you plan to use it – Davide Piras Aug 20 '18 at 15:40
-
Do you mean [Virtual Key Codes](https://learn.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes)? – meowgoesthedog Aug 20 '18 at 15:40
-
Hmm, no, 202 is the message number. It is an int, not IntPtr. Basic way to get ahead is to google "windows message numbers". Or simply add Debug.WriteLine(m.ToString()) to your WndProc() method, it is smart enough to decode the message, if it is known one. – Hans Passant Aug 20 '18 at 15:42
1 Answers
1
IntPtr
is just an integer value in C# (precisely, native (platform-specific) size integer
), often used for interop with unmanaged code. There is no specific meaning for values out of context.
Looks like you work with WinAPI messages, because 202 comes from #define WM_LBUTTONUP 0x0202
.
Also you seem to confuse hexadecimal and decimal values.
562
is0x0232
which is WM_EXITSIZEMOVE .161
is0x00A1
which is WM_NCLBUTTONDOWN
Refer to documentation for other values: https://learn.microsoft.com/en-us/windows/desktop/inputdev/wm-lbuttonup

Pavel Tupitsyn
- 8,393
- 3
- 22
- 44