I want to get the contents of an application control / descriptor.
Here's the experimental code.
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 }
any idea? I read some API method like GetWindowText or WM_GETTEXT, but I donβt know how to use it or apply it on my code. I need a tutorial or sample code ...
Thank you in advance:)
source share