title: Using SendMessage to enter text into an edit control belonging to another process
body: <p>I want to set up text in edit box programatically in other program, which is a game app and using directX, but running in window mode. I'm doing this:</p>
  
  <pre><code>HWND hWnd = FindWindow(NULL,"Game");
  HWND edit = FindWindowEx(hWnd, NULL, "Edit", NULL);
  
  SendMessage(edit, WM_CHAR, (TCHAR) 'H', 0);
  SendMessage(edit, WM_CHAR, (TCHAR) 'E', 0);
  SendMessage(edit, WM_CHAR, (TCHAR) 'L', 0);
  SendMessage(edit, WM_CHAR, (TCHAR) 'L', 0);
  SendMessage(edit, WM_CHAR, (TCHAR) 'O', 0);
  </code></pre>
  
  <p>this not working for me.... but some how once worked. I think I misunderstood something, maybe it must focus on edit control, then set cursor then paste text and then disable focus... I realy don't know much...please save my time and nervs, tell me how to make it working....</p>
  
  <p>I tried this too, and not working: </p>
  
  <pre><code>SendMessage(hwnd, WM_SETTEXT, NULL, (LPARAM)"text");
  </code></pre>
  
  <p>hwnd is correct, but text is not updated... it send to correct handle, but not updated.... I think I need somehow to focus or update, once it updated successful, but I didnt realized what happened...so code worked once, but no more working...  why one time it worked?</p>