C# 如何等待弹出窗口并选择它进行输入
我基本上是用 C# 编写一个专门的宏播放器/录音器。我需要做的一件事是等待弹出窗口(类似于“另存为...”对话框),然后我可以选择继续播放宏输入。理想情况下,我希望能够轮询打开的窗口并通过其标题搜索匹配的窗口标题。 显然我不能使用 Processes.GetProcesses() 因为对话框很可能不会显示为新进程。
我在哪里可以找到打开的窗口及其标题?
I am basically writing a specialized macro player/recorder in C#. One thing I need to be able to do is wait for a pop up window (something like a Save As... dialog box) that I can then select to continue playing macro input into. Ideally, I would like to be able to poll for open windows and search through their titles for a matching window title.
Obviously I can't use Processes.GetProcesses() because a dialog most likely will not show up as a new process.
Where do I look to get open windows and their titles?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果要轮询所有打开的窗口,可以使用 EnumWindows ()。我没有编译这段代码,但它应该非常接近功能。
If you want to poll all open windows, you might use EnumWindows(). I didn't compile this code, but it should be pretty close to functional.
我想你想要
FindWindow()
。I think you want
FindWindow()
.