Я хочу получить содержимое элемента управления/дескриптора приложения.
Здесь экспериментальный код.
Process[] processes = Process.GetProcessesByName("Notepad");
foreach (Process p in processes)
{
StringBuilder sb = new StringBuilder();
IntPtr pFoundWindow = p.MainWindowHandle;
List <IntPtr> s = GetChildWindows(pFoundWindow);
// function that returns a
//list of handle from child component on a given application.
foreach (IntPtr test in s)
{
// Now I want something here that will return/show
the text on the notepad..
}
GetWindowText(pFoundWindow, sb,256);
MessageBox.Show(sb.ToString()); // this shows the title.. no problem with that
}
любая идея? Я прочитал некоторый API-метод, например GetWindowText или WM_GETTEXT, но я не знаю, как его использовать или применять его на моем коде. Мне нужен учебник или образец кода...
Заранее спасибо:)