I wrote a program which programmatically presses the "Install" button on a WebPlatformInstaller., but it doesn't find this button. Can you help me fix this code?
Windows: 00030590 Text: Install Class: WindowsForms10.BUTTON.app.0.378734a Style: 5601000B
This is my code:
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);
}