title: C# how to use WM_GETTEXT / GetWindowText API / Window Title
body: <p>I want to get the content of the control / handle of an application..</p>
  
  <p>Here's the experimental code..</p>
  
  <pre><code> Process[] processes = Process.GetProcessesByName("Notepad");
          foreach (Process p in processes)
          {
              StringBuilder sb = new StringBuilder();
              IntPtr pFoundWindow = p.MainWindowHandle;
               List &lt;IntPtr&gt; 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
  
          } 
  </code></pre>
  
  <p>any idea?
  I've read some API method like GetWindowText or WM_GETTEXT but I dont know how to use it or apply it on my code.. 
  I need  a tutorial or sample code...</p>
  
  <p>Thanks in advance : )</p>