private String GetClassName(IntPtr hWnd) { STRINGBUFFER sb; Win32API.GetClassName(hWnd, out sb, 40); return(sb.szText); }
private IntPtr findWndClass(IntPtr hWnd, IntPtr child) { IntPtr hc = Win32API.FindWindowEx(hWnd, child, "CLIPBRDWNDCLASS", null); STRINGBUFFER sb; Win32API.GetClassName(hc, out sb, 15); if (sb.szText.ToUpper().Equals("CLIPBRDWNDCLASS")) { MessageBox.Show(sb.szText); } else { findWndClass(hWnd, hc); } Console.WriteLine(sb.szText); return(hc); }