I have a program that is not mine that has 3 TEdit boxes and 3 TButton objects. I can easily get the button handles by using:
IntPtr buttonhwnd = FindWindowEx(mainhwnd, IntPtr.Zero, "TButton", "Button Text");
But I can’t do the same with the Edit boxes since they don’t have any text in them. Therefore FindWindowEx(hWnd, IntPtr.Zero, "TEdit", "") can get all of them. However, it only gets the first one it comes across and I need the last one. Is there a way to skip a number of boxes or differentiate between them?
I found the answer:
Given there are 3 controls, I can use:
Although not dynamic, it gets the job done for me. However, for future reference for people who might need this: Is there a way to differentiate between them besides knowing what Z position they’re in?