GetClassInfoEx (user32)
Last changed: -74.212.46.188

.
Summary

C# Signature:

[DllImport(user32, SetLastError = true)]
static extern Boolean GetClassInfoEx(IntPtr hInstance, String lpClassName, ref WNDCLASSEX lpWndClass);

VB.NET Signature:

<DllImport("user32", SetLastError:=True)> _
Private Shared Function GetClassInfoEx(hInstance As IntPtr, lpClassName As String, ByRef lpWndClass As WNDCLASSEX) As Boolean
End Function

User-Defined Types:

None.

Notes:

Be sure to set cbSize member of WNDCLASSEX structure before calling the GetClassInfoEx function.

Tips & Tricks:

Please add some!

Sample Code:

IntPtr hinstance = Marshal.GetHINSTANCE(GetType().Module);
String className = "Required Class Name";
WNDCLASSEX wndClass = new WNDCLASSEX { cbSize = (uint)Marshal.SizeOf(typeof(WNDCLASSEX)) };

if (GetClassInfoEx(hinstance, className, ref wndClass))
{
   // Class exists
}

Alternative Managed API:

Do you know one? Please contribute it!

Documentation