@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The GetClassLongPtr API !!!!C# Signature: 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); !!!!VB.NET Signature: Public Shared Function GetClassLongPtr(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr If IntPtr.Size > 4 Then Return GetClassLongPtr64(hWnd, nIndex) Else Return New IntPtr(GetClassLongPtr32(hWnd, nIndex)) End If End Function <DllImport("user32.dll", EntryPoint:="GetClassLong")> _ Public Shared Function GetClassLongPtr32(ByVal hWnd As HandleRef, <MarshalAs(UnmanagedType.I4)>nIndex As ClassLongFlags) As UInteger End Function <DllImport("user32.dll", EntryPoint:="GetClassLongPtr")> _ Public Shared Function GetClassLongPtr64(ByVal hWnd As HandleRef, <MarshalAs(UnmanagedType.I4)>nIndex As ClassLongFlags) As IntPtr End Function !!!!VB Signature: Public Declare Function GetClassLongPtr Lib "user32" (ByVal hWnd As Long, _ ByVal nIndex As ClassLongFlags) As Long !!!!User-Defined Types: [ClassLongFlags] !!!!Notes: GetClassLongPtr is 64-bit safe, GetClassLong is not. Because GetClassLongPtr is not available on older 32-bit operating systems, a special wrapper function is required. The MSDN documentation specifies that GetClassLongPtr is supported on older 32-bit operating systems such as Windows 95. However, the Win32 API actually uses a macro to change GetClassLongPtr to GetClassLong on these older systems. Testing the size of the IntPtr is the easiest way to determine if the platform is 64-bit. !!!!Tips & Tricks: Please add some! !!!!Sample Code: Please add some! !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: GetClassLongPtr@msdn on MSDN
Edit user32.GetClassLong
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.