title: How to read a chart winapi c#
body: <p>i have used this code to get the handle of a child window in the chart,</p>
  
  <pre><code>    [DllImport("user32")]
      [return: MarshalAs(UnmanagedType.Bool)]
      public static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr i);
      public static List&lt;IntPtr&gt; GetChildWindows(IntPtr parent)
      {
          List&lt;IntPtr&gt; result = new List&lt;IntPtr&gt;();
          GCHandle listHandle = GCHandle.Alloc(result);
          try
          {
              EnumWindowProc childProc = new EnumWindowProc(EnumWindow);
              EnumChildWindows(parent, childProc, GCHandle.ToIntPtr(listHandle));
          }
          finally
          {
              if (listHandle.IsAllocated)
                  listHandle.Free();
          }
          return result;
      }
      private static bool EnumWindow(IntPtr handle, IntPtr pointer)
      {
          GCHandle gch = GCHandle.FromIntPtr(pointer);
          List&lt;IntPtr&gt; list = gch.Target as List&lt;IntPtr&gt;;
          if (list == null)
          {
              throw new InvalidCastException("GCHandle Target could not be cast as List&lt;IntPtr&gt;");
          }
          list.Add(handle);
  
          return true;
      }
  
  
      public delegate bool EnumWindowProc(IntPtr hWnd, IntPtr parameter);
      static void Main(string[] args)
      {
          foreach (Process Proces in Process.GetProcesses())
          {             
  
                  IntPtr lastWindowHandle = GetWindow(Proces.MainWindowHandle, (uint)GetWindow_Cmd.GW_HWNDNEXT);
                  GetChildWindows(Proces.MainWindowHandle);
  
          }
      }
  </code></pre>
  
  <p>i want to get the open high low close of candles from the chart but i dont know how to read that.I have used this code to read get the data from the chart but it is returning empty string.</p>
  
  <pre><code>    public object GetWindowText(IntPtr hWnd)
      {
          functions.StrData = "";
          object obj2 = "";
          if (hWnd.Equals(IntPtr.Zero))
          {
              return "";
          }
          functions.SendMessage(hWnd, 0x111, (IntPtr)0x81eb, IntPtr.Zero);
          functions.StrData = functions.StrData + Clipboard.GetText();
          functions.SendMessage(hWnd, 0x307, IntPtr.Zero, IntPtr.Zero);
          return obj2;
      }
  </code></pre>
  
  <p>I have also used .Net Object Spy to know what the handle is,here is the picture of it</p>
  
  <p><a href="http://i.stack.imgur.com/HNtvc.jpg" rel="nofollow">http://i.stack.imgur.com/HNtvc.jpg</a></p>
  
  <p>I just want to read the highlighted windows and get the candles data whose handle is 4982638.Hope you all understood my question,thanks in advance..</p>