谢谢各位,已经找到办法解决了。 打开Exe程序后,将该程序作为当前工作窗口。由于Start按钮设置了虚拟键盘来启动,所以当前程序只要发送键盘上的按键即可。
用API,先获得窗口句柄,然后发送消息命令。
private static System.Diagnostics.Process p; if (p == null) { p = new System.Diagnostics.Process(); p.StartInfo.FileName = "XXX.exe"; p.Start(); } else { if (p.HasExited) //是否正在运行 { p.Start(); } } p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
111,126
社区成员
642,541
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧