title: how to read a datagridview of another application
body: <p>I want to read a 'DataGridView' of an application. There is an application in which many child windows are there. Here is a picture of that application and the window containing the datagridview which I want to read, I've highlighted the window which I want to read</p>
  
  <p><img src="https://i.stack.imgur.com/DPjE4.jpg" alt="application"></p>
  
  <p>I've searched the window through UISPY and here is the picture of the window and datagridview in it. I've highlighted the control which I want to be read. </p>
  
  <p><img src="https://i.stack.imgur.com/MDF30.jpg" alt="enter image description here"></p>
  
  <p>I've used this code(Winapi) to read the control but I am getting an empty string</p>
  
  <pre><code>public object WindowText(IntPtr hWnd)
  {
      object obj2 = "";
      if (hWnd.Equals(IntPtr.Zero))
      {
          return "";
      }
      // 0x111 is WM_COMMAND
      MainModule.SendMessage(hWnd, 0x111, (IntPtr)0x81eb, IntPtr.Zero);
      MainModule.StrData = MainModule.StrData + Clipboard.GetText();
      // 0x307 is WM_DESTROYCLIPBOARD
      MainModule.SendMessage(hWnd, 0x307, IntPtr.Zero, IntPtr.Zero);
      return obj2;
  }
  </code></pre>
  
  <p>I've also tried UI Automation but i didn't succeed in reading through it also.<br>
  The datagridview has some cells which are updated every second(Live data) and I want to read it and store it.
  I want to read the the cells and columns(Symbol,Bid,Ask) and the cell contents(AUDCAD,AUDCHF) etc.</p>