我编写了一个以编程方式按下"安装" WebPlatformInstaller上的按钮,但它没有找到此按钮。你能帮我解决这个问题吗?
Windows:00030590 文字:安装 类:WindowsForms10.BUTTON.app.0.378734a 风格:5601000B
这是我的代码:
Process[] processes = Process.GetProcessesByName("WebPlatformInstaller");
foreach (Process p in processes)// debug shows that there is 1 process
{
IntPtr ButtonHandle = FindWindowEx(p.MainWindowHandle, IntPtr.Zero, "Install", null);
SendMessage(ButtonHandle, BM_CLICK, IntPtr.Zero, IntPtr.Zero);
}