I was using GetWindowLong like this:
[DllImport("user32.dll")]
private static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex);
But according to the MSDN docs I am supposed to be using GetWindowLongPtr to be 64bit compatible. 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 be using IntPtr as the return type, but what the heck would I use for an equivalent for LONG_PTR? I have also seen GetWindowLong defined as this in C#:
[DllImport("user32.dll")]
private static extern long GetWindowLong(IntPtr hWnd, int nIndex);
What is right, and how can I ensure proper 64bit compatibility?