I am trying to send an enter command using c #, I can write to another process using this dll, but when I am trying to send the enter command it is written the following "{ENTER}" ...
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern string SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
When I try to use a PostMessage nothing happens ..
public void SendMessage(string message, IntPtr WindowHandle)
{
foreach (char c in message)
{
int charValue = c;
IntPtr val = new IntPtr((Int32)c);
Win32.SendMessage(WindowHandle, WM_CHAR, val, new IntPtr(0));
}
}
Could someone help me?