GetClassName (user32)
Last changed: EE-188.194.30.93

.
Summary

sadasdasdas

VB Signature:

<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
Private Shared Sub GetClassName(ByVal hWnd As System.IntPtr, _
   ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer)
    ' Leave function empty    
End Function

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

C# Sample Code

private static bool isIEServerWindow(IntPtr hWnd)
{
    IntPtr Res;
    StringBuilder ClassName = new StringBuilder(100);
    //Get the window class name
    Res = Win32.GetClassName(hWnd, ClassName, ClassName.Capacity);
    if(Res != IntPtr.Zero)
    {
        return (string.Compare(ClassName.ToString(), "Internet Explorer_Server",true,CultureInfo.InvariantCulture) == 0);
    }
    else
    {
        return false;
    }
}

VB.NET Sample Code

Create a new VB .NET form and add a button Button1 to it.

Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
   Dim sClassName As New StringBuilder("", 256)
   'pass in the handle of the object for which to get
   'the class name; for example, the form's handle
   Call GetClassName(Me.Handle, sClassName, 256)
   MessageBox.Show(sClassName.ToString)
End Sub

Alternative Managed API:

Do you know one? Please contribute it!

Documentation