I'm using FindWindow()
and FindWindowEx()
to control an application. There are 2 buttons in the application, one named "I Agree" and the second "Cancel". I can find the "Cancel" button but can't find the "I Agree" button.
I'm using FindWindow()
to find the application, and I store the window's process in the hwnd
variable.
Then I do this to find and get a button:
hwndChild = FindWindowEx((IntPtr)hwnd, IntPtr.Zero, "Button", "Cancel");
Why can't I find the "I Agree" button, but I can find the "Cancel" button?.