简体   繁体   English

FindWindowEx 找不到按钮

[英]Can't find a button with FindWindowEx

I'm using FindWindow() and FindWindowEx() to control an application.我正在使用FindWindow()FindWindowEx()来控制应用程序。 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.我正在使用FindWindow()来查找应用程序,并将窗口的进程存储在hwnd变量中。 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?.为什么我找不到“我同意”按钮,但我可以找到“取消”按钮?。

应用程序中的按钮。

The "I Agree" button is actually "I &Agree". “我同意”按钮实际上是“我同意”。 Check out this to find out why. 看看这个找出原因。 Thanks!谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM