Z
Zytan
Most code on the net is wrong. This is SendMessage():
LRESULT SendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
lParam);
All of those parameters are 32/64-bit in size depending on the
compiler, except for UINT which is a C int, which is always 32-bit,
even on a 64-bit machine, AFAIK. Most code on the net uses C# int (32-
bit) for all (or some) of these, when it should use IntPtr, which is
32/64-bit.
Now, I've seen code use HandleRef for the hWnd, instead of IntPtr, but
I cannot pass Control.Handle into a HandleRef, since it returns
IntPtr. So, should I stick with IntPtr? Or is HandleRef better?
Also, I want to do this:
const IntPtr SB_BOTTOM = 7;
But, C# doesn't allow me to make IntPtr constant, like I could do with
int! AND I cannot just store 7 into an IntPtr, since it's a type
conversion. Dammit. Is there another 32/64 integer data type that I
could use in place of IntPtr that IS allowed to be constant, which
acts like an int?
I am surprised at how annoying all of this is. No wonder people just
use int (and wait for their app to blow up on 64-bit).
Zytan
LRESULT SendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
lParam);
All of those parameters are 32/64-bit in size depending on the
compiler, except for UINT which is a C int, which is always 32-bit,
even on a 64-bit machine, AFAIK. Most code on the net uses C# int (32-
bit) for all (or some) of these, when it should use IntPtr, which is
32/64-bit.
Now, I've seen code use HandleRef for the hWnd, instead of IntPtr, but
I cannot pass Control.Handle into a HandleRef, since it returns
IntPtr. So, should I stick with IntPtr? Or is HandleRef better?
Also, I want to do this:
const IntPtr SB_BOTTOM = 7;
But, C# doesn't allow me to make IntPtr constant, like I could do with
int! AND I cannot just store 7 into an IntPtr, since it's a type
conversion. Dammit. Is there another 32/64 integer data type that I
could use in place of IntPtr that IS allowed to be constant, which
acts like an int?
I am surprised at how annoying all of this is. No wonder people just
use int (and wait for their app to blow up on 64-bit).
Zytan