I want to create the same function "Find windows..." of spy++ in C#. I have try with this function of the WINAPI:
HWND WINAPI WindowFromPoint(__in POINT Point);
http://msdn.microsoft.com/en-US/library/ms633558.aspx But i don't arrive to get all element with that, because they are disabled or hidden.
For example with the window 7 calculator in Programmer mode, i cannot get the "A B C D E F" with my program if they are disable then spy++ can get it.
Edit: I have try this but it don't working:
[DllImport("user32.dll")]
public static extern ulong GetClassLongPtr(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
public static extern IntPtr ChildWindowFromPointEx(IntPtr hWndParent, Win32Point pt, uint uFlags);
IntPtr hWnd = WindowFromPoint(myPoint);
hWnd= ChildWindowFromPointEx(hWnd , myPoint, 0x0000);
myPoint is the position of my mouse.
I don't familiar with the WINAPI and i imagine with your explanation that is a lack of understanding of me. It's possible to have a little example of ChildWindowFromPointEx function or know what my code don't working? thanx for your answer
I have try to create the loop but, it seems the handle is under the other handle but is not children of the handle, the loop send alway the same handle and no the desire child when the key " a b c d e f" is disabled. Do you have another idea?