public static int GetClassName(IntPtr hWnd, out string lpString) { WindowsAPI.STRINGBUFFER sTRINGBUFFER = default(WindowsAPI.STRINGBUFFER); int className = WindowsAPI.GetClassName(hWnd, out sTRINGBUFFER, 512); lpString = sTRINGBUFFER.szText; return(className); }