using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WindowsFormsApplication1 { public partial class Form1 : Form { [DllImport(&quot;user32.dll&quot;)] public static extern IntPtr FindWindow(String sClassName, String sAppName); [DllImport(&quot;user32.dll&quot;)] public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { // Find and save calculator as thisWindow IntPtr thisWindow = FindWindow(null, &quot;Calculator&quot;); //Press button "8" on calulator app SendMessage((int)thisWindow, 006303C8, 0, IntPtr.Zero); } } }</pre></pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)