C# get child handles using FindWindowEx by name and ordinal number
问题 According to http://msdn.microsoft.com/en-us/library/ms633500(v=vs.85).aspx I define FindWindowEx function. using System.Runtime.InteropServices; [DllImport("user32.dll", CharSet=CharSet.Unicode)] static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); Now I am able to find first handle of "Button" control (get name from Spy++) setting childAfter as IntPtr.Zero . IntPtr hWndParent = new IntPtr(2032496); // providing parent window