public static IntPtr GetClassLongPtr(HandleRef hWnd, int nIndex)
{
if (IntPtr.Size > 4)
return GetClassLongPtr64(hWnd, nIndex);
else
return new IntPtr(GetClassLongPtr32(hWnd, nIndex));
}
[DllImport("user32.dll", EntryPoint="GetClassLong")]
public static extern uint GetClassLongPtr32(HandleRef hWnd, int nIndex);
[DllImport("user32.dll", EntryPoint="GetClassLongPtr")]
public static extern IntPtr GetClassLongPtr64(HandleRef hWnd, int nIndex);
None.
GetClassLongPtr is 64-bit safe, GetClassLong is not.
Because GetClassLong is not available on older 32-bit operating systems, a special wrapper function is required.
Testing the size of the IntPtr is the easiest way to determine if the platform is 64-bit.
Please add some!
Please add some!
Do you know one? Please contribute it!