[英]How to to fill out another program's pop up fields programmatically in C#?
I have a C++ program that is launched using cmd.我有一个使用 cmd 启动的 C++ 程序。 After being launched, he show off a pop up where the user has to write his login/password.
启动后,他展示了一个弹出窗口,用户必须在其中输入他的登录名/密码。
I want to launch this program with another program (wrote in C#), I know how to do that with System.Diagnostics.Process.Start
.我想用另一个程序(用 C# 编写)启动这个程序,我知道如何用
System.Diagnostics.Process.Start
来做到这一点。
So my question is: ho can I fill the login/password's fields in my C# program ?所以我的问题是:我可以在我的 C# 程序中填写登录名/密码字段吗?
Answer:回答:
@DmitriyZapevalov was right. @DmitriyZapevalov 是对的。 Here is some usefull links that helped me:
以下是一些对我有帮助的有用链接:
You have to use Windows API through Interop:您必须通过 Interop 使用 Windows API:
HWND
)HWND
)SendMessage(WM_SETTEXT)
)SendMessage(WM_SETTEXT)
) You can find fields and windows by names or IDs.您可以按名称或 ID 查找字段和窗口。
Use Spy++
to investigate popup window layout.使用
Spy++
调查弹出窗口布局。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.