Send a Enter command using Sendmessage Or Postmessage DLL

Asked

Viewed 76 times

0

I am trying to send a enter command using c #, I can write in another process using this dll, but when I am trying to send the enter command 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));
     }
 }

Someone could help me?

  • 1

    Not just include n in the string?

  • I tested here and nothing happens, nor write he writes, just ignores

  • I’m still trying, someone might try to help me?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.