Im not quite sure why this wont work.Code:private void button1_Click(object sender, EventArgs e) { const int WM_KEYDOWN = 0x100; const int WM_KEYUP = 0x101; Form1 Frm = new Form1(); //IntPtr notepad = FindWindow("Form1", null); IntPtr editx = FindWindowEx(this.Handle, IntPtr.Zero, "textbox", null); PostMessage(editx, WM_KEYDOWN, (int)Keys.A, 0); PostMessage(editx, WM_KEYUP, (int)Keys.A, 0); }
Im trying to send the Key "A" to a textbox on the form that the button is pressed on.
Also, where the code is commented, What would I lock onto? Form1? Form 1's text?
Thanks in advance![]()
Results 1 to 8 of 8
Thread: [C#][Help]Postmessage Api
Threaded View
- 03 Aug. 2010 12:14am #1
[C#][Help]Postmessage Api
Shh, I'm watching My little pony.