Well, I\'ve tried my best to look at code examples and posts all over the web on how to do this, but I haven\'t been able to make any headway in a few months using windows A
Since you say you're using C# you should be using the System.Windows.Automation
namespace, whose entire purpose in life is to allow you to control other programs via automation.
You didn't give details as to what you wanted, but here's a program that pushes "7" in the calculator.
using System.Windows.Automation;
class Program
{
public static void Main()
{
var calcWindow = AutomationElement.RootElement.FindFirst(
TreeScope.Children,
new PropertyCondition(AutomationElement.NameProperty, "Calculator"));
if (calcWindow == null) return;
var sevenButton = calcWindow.FindFirst(TreeScope.Descendants,
new PropertyCondition(AutomationElement.NameProperty, "7"));
var invokePattern = sevenButton.GetCurrentPattern(InvokePattern.Pattern)
as InvokePattern;
invokePattern.Invoke();
}
}