ACAT.Lib.Core.Utility.Windows.GetText C# (CSharp) Метод

GetText() публичный статический Метод

Gets text from the speficied window
public static GetText ( IntPtr hWnd ) : string
hWnd System.IntPtr window handle
Результат string
        public static string GetText(IntPtr hWnd)
        {
            var title = new StringBuilder();

            // Get the size of the string required to hold the window title.
            Int32 size = User32Interop.SendMessageIntInt(hWnd, User32Interop.WM_GETTEXTLENGTH, 0, 0).ToInt32();

            // If the return is 0, there is no title.
            if (size > 0)
            {
                title = new StringBuilder(size + 1);

                User32Interop.SendMessageStringBuilder(hWnd, User32Interop.WM_GETTEXT, title.Capacity, title);
            }
            return title.ToString();
        }

Same methods

Windows::GetText ( Control control ) : String

Usage Example

Пример #1
0
 /// <summary>
 /// The search filter changed.  Reload the file list
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">event args</param>
 private void SearchFilter_TextChanged(object sender, EventArgs e)
 {
     _pageNumber     = 0;
     _pageStartIndex = 0;
     _fileList       = filterFiles(_allFilesList, _includeFileExtensions, _excludeFileExtensions, Windows.GetText(SearchFilter));
     refreshFileList();
 }
All Usage Examples Of ACAT.Lib.Core.Utility.Windows::GetText