public static string GetClassName(IntPtr hWnd) { var title = new StringBuilder(MaxTitle); var titleLength = Win32Interop.GetClassName(hWnd, title, title.Capacity + 1); title.Length = titleLength; return(title.ToString()); }
private bool Callback(IntPtr hWnd, IntPtr lparam) { if (Win32Interop.GetClassName(hWnd, _apiResult, _apiResult.Capacity) != 0) { if (string.CompareOrdinal(_apiResult.ToString(), _className) == 0) { _result.Add(hWnd); } } return(true); // Keep enumerating. }