title: C# get child handles using FindWindowEx by name and ordinal number
body: <p>According to <a href="http://msdn.microsoft.com/en-us/library/ms633500(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms633500(v=vs.85).aspx</a> I define FindWindowEx function.</p>
  
  <pre><code>using System.Runtime.InteropServices;
  
  [DllImport("user32.dll", CharSet=CharSet.Unicode)]
  static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); 
  </code></pre>
  
  <p>Now I am able to find <strong>first</strong> handle of "Button" control (get name from Spy++) setting childAfter as <strong>IntPtr.Zero</strong>.</p>
  
  <pre><code>IntPtr hWndParent = new IntPtr(2032496);  // providing parent window handle
  IntPtr hWndButton = FindWindowEx(hWndParent, IntPtr.Zero, "Button", string.Empty);
  </code></pre>
  
  <p>How to get <strong>second</strong>, <strong>third</strong> or any handle of "Button" control inside that parent window? The fact is, button titles may vary, so I cannot find them directly by name defining fourth parameter.</p>