I used GetWindowLong as follows:
[DllImport("user32.dll")] private static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex);
But according to the MSDN docs, I have to use GetWindowLongPtr for compatibility with the 64-bit version. http://msdn.microsoft.com/en-us/library/ms633584(VS.85).aspx
The MSDN docs for GetWindowLongPtr say that I should define it like this (in C ++):
LONG_PTR GetWindowLongPtr(HWND hWnd, int nIndex);
I used to use IntPtr as the return type, but what the hell would I use for the equivalent for LONG_PTR? I also saw that GetWindowLong is defined like this in C #:
[DllImport("user32.dll")] private static extern long GetWindowLong(IntPtr hWnd, int nIndex);
What is correct and how can I ensure proper 64-bit compatibility?
c #
Jon Tackabury Nov 26 '08 at 3:30 2008-11-26 03:30
source share