0

I need to take a text from textbox1 and putt it in other program text box . How can I do that and with what?

so far i saw SendKey but that is sending the specify text and my text will change and will not send text to specify text box of another application i finded something like this but I don't see where to putt secify application

using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        const uint WM_SETTEXT = 0x000C;

        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        static extern IntPtr SendMessage(IntPtr hWnd, unit Msg, 
            IntPtr wParam, string lParam);

        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            MessageBox.Show(textBox1.Text);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SendMessage(textBox1.Handle, WM_SETTEXT, IntPtr.Zero,
              textBox1.Text + ", " + textBox1.Text);
        }
    }
}
Joe
  • 9
  • 5

1 Answers1

1

You need to implement interprocess communication, Please check this link What is the simplest method of inter-process communication between 2 C# processes

In this link you can find multiple options to implement interprocess communication such as:

  • Windows Communication Foundation
  • Windows Messages
Community
  • 1
  • 1
Shardul Wagh
  • 80
  • 11