As for the window descriptor (that is, the number), to display its title, I can’t get it, can someone tell me?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; namespace parol_udal { class Program { [DllImport("user32.dll",CharSet=CharSet.Auto,SetLastError=true)] public static extern IntPtr FindWindow(string sClassName,string sWindowName); [DllImport("user32.dll",CharSet=CharSet.Auto,SetLastError=true)] public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpClassName, string lpWindowName); [DllImport("user32.dll",CharSet=CharSet.Auto ,SetLastError = true)] public static extern int GetWindowText (IntPtr hwnd,StringBuilder lpString,int nMaxCount); [DllImport("user32.dll",CharSet=CharSet.Auto, SetLastError = true)] static extern int GetWindowTextLength(IntPtr hWnd); static void Main() { IntPtr thisWindow = FindWindow(null, "Окно"); IntPtr Rod = thisWindow; IntPtr otherWindow = FindWindowEx(Rod, IntPtr.Zero, "RICHEDIT50W", null); int len = GetWindowTextLength(otherWindow); StringBuilder sb = new StringBuilder(len); len = GetWindowText(otherWindow, sb, len); Console.WriteLine(sb.ToString(0,len)); //выводит пустую строку Console.WriteLine(thisWindow); //выводлит дескриптор родителя Console.WriteLine(otherWindow);//выводит дескриптор приемника Console.ReadKey(true); } } } Please help, how to get title "otherWindow"?