I need to get the handle of a button. I know the window caption and even the button caption, but I don't know the descending "child-tree" from the window to the button. Also, there are unknown classes in the tree. I can't easily recreate the event to use Spy++.
Can someone post the code to do some kind of nested or recursive FindWindowEx to find my button's hwnd? Remember, I don't know how far down my button is a descendent and I don't know which classes to follow down the tree. We can assume that there will be only one such button. FindWindowEx seems to search only the specified "sibling-level".
This format would be excellent:
MyDesiredHwnd = YourCoolFunction(MyKnownWindowCaption, MyKnownButtonCaption)