[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpclassname, string lpwindowname);
[DllImport("user32.dll")]
public static extern IntPtr FindWindowEx(IntPtr hwndparent, IntPtr hwndchildafter, string lpszclass, string lpszwindow);
IntPtr hwnd_win;
IntPtr hwnd_button;
hwnd_win = FindWindow("windowsforms10.window.8.app3", "form1");
hwnd_button = FindWindowEx(hwnd_win, new IntPtr(0), "windowsforms10.button.app3", "button1");